Example usage for android.app Activity getApplication

List of usage examples for android.app Activity getApplication

Introduction

In this page you can find the example usage for android.app Activity getApplication.

Prototype

public final Application getApplication() 

Source Link

Document

Return the application that owns this activity.

Usage

From source file:io.jawg.osmcontributor.ui.dialogs.EditPoiTypeDialogFragment.java

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    ((OsmTemplateApplication) activity.getApplication()).getOsmTemplateComponent().inject(this);
    bus.register(this);
}

From source file:com.microsoft.assetmanagement.tasks.SaveCarTask.java

/**
 * Instantiates a new save car task./*ww  w  .ja  va 2  s. co  m*/
 *
 * @param activity the activity
 */
public SaveCarTask(Activity activity) {
    mActivity = activity;
    mDialog = new ProgressDialog(mActivity);
    mApplication = (AssetApplication) activity.getApplication();
    mSource = new ListItemsDataSource(mApplication);
}

From source file:com.microsoft.assetmanagement.tasks.DeleteCarTask.java

/**
 * Instantiates a new delete car task./* w w w. j a  va  2s.c om*/
 *
 * @param activity the activity
 */
public DeleteCarTask(Activity activity) {
    mActivity = activity;
    mDialog = new ProgressDialog(mActivity);
    mApplication = (AssetApplication) activity.getApplication();
    mSource = new ListItemsDataSource(mApplication);
}

From source file:com.microsoft.assetmanagement.tasks.UpdateCarTask.java

/**
 * Instantiates a new update car task./*from w  w w  .  ja  v  a 2s.c  o  m*/
 *
 * @param activity the activity
 */
public UpdateCarTask(Activity activity) {
    mActivity = activity;
    mDialog = new ProgressDialog(mActivity);
    mApplication = (AssetApplication) activity.getApplication();
    mSource = new ListItemsDataSource(mApplication);
}

From source file:pl.edu.pw.eiti.groupbuying.android.fragment.AbstractListFragment.java

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    application = (GroupBuyingApplication) activity.getApplication();
    mainActivity = (MainMenuActivity) activity;
}

From source file:io.jawg.osmcontributor.ui.dialogs.EditPoiTagDialogFragment.java

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    ((OsmTemplateApplication) activity.getApplication()).getOsmTemplateComponent().inject(this);
}

From source file:cn.newgxu.android.bbs.ui.ForumFragment.java

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    this.app = (BBSApplication) activity.getApplication();
}

From source file:com.microsoft.filediscovery.tasks.SaveFileTask.java

/**
 * Instantiates a SaveFileTask task//from  w ww.  j  a v a  2 s. c  o m
 *
 * @param activity the activity
 */
public SaveFileTask(Activity activity) {
    mActivity = activity;
    mDialog = new ProgressDialog(mActivity);
    mApplication = (DiscoveryAPIApplication) activity.getApplication();
    mSource = new ListItemsDataSource(mApplication);
}

From source file:cn.newgxu.android.bbs.ui.UserFragment.java

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    app = (BBSApplication) activity.getApplication();
}

From source file:com.kncwallet.wallet.ui.WalletAddressFragment.java

@Override
public void onAttach(final Activity activity) {
    super.onAttach(activity);

    this.activity = (FragmentActivity) activity;
    this.application = (WalletApplication) activity.getApplication();
    this.prefs = PreferenceManager.getDefaultSharedPreferences(activity);
    this.nfcManager = (NfcManager) activity.getSystemService(Context.NFC_SERVICE);
}