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:org.mozilla.mozstumbler.client.navdrawer.MetricsView.java

private boolean isScanningOrPaused() {
    if (mView.getContext() instanceof Activity) {
        Activity activity = (Activity) mView.getContext();
        if (activity.getApplication() != null) {
            MainApp app = (MainApp) activity.getApplication();
            return app.isScanningOrPaused();
        }//from   w  w w .j  av a 2  s .c  o m
    }
    return false;
}

From source file:mintcoin.wallet.ui.WalletAddressFragment.java

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

    this.activity = activity;
    this.application = (WalletApplication) activity.getApplication();
    this.loaderManager = getLoaderManager();
    final NfcManager nfcManager = (NfcManager) activity.getSystemService(Context.NFC_SERVICE);
    this.nfcAdapter = nfcManager.getDefaultAdapter();
}

From source file:biz.wiz.android.wallet.ui.WalletAddressFragment.java

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

    this.activity = activity;
    this.application = (WalletApplication) activity.getApplication();
    this.wallet = application.getWallet();
    this.loaderManager = getLoaderManager();
    final NfcManager nfcManager = (NfcManager) activity.getSystemService(Context.NFC_SERVICE);
    this.nfcAdapter = nfcManager.getDefaultAdapter();
}

From source file:com.feathercoin.wallet.feathercoin.ui.ExchangeRatesFragment.java

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

    this.activity = (AbstractWalletActivity) activity;
    this.application = (WalletApplication) activity.getApplication();
    this.prefs = PreferenceManager.getDefaultSharedPreferences(activity);
    this.loaderManager = getLoaderManager();
}

From source file:de.langerhans.wallet.ui.ImportKeysQrFragment.java

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

    this.activity = (AbstractWalletActivity) activity;
    this.application = (WalletApplication) activity.getApplication();
    this.wallet = application.getWallet();
    this.contentResolver = activity.getContentResolver();
    this.loaderManager = getLoaderManager();
}

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

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    this.app = (BBSApplication) activity.getApplication();
    this.data = new LinkedList<Map<String, Object>>();
    this.forumId = getArguments().getInt(Consts.FID);
    this.isClassic = getArguments().getBoolean(Consts.IS_CLASSIC, false);
}

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

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    this.app = (BBSApplication) activity.getApplication();
    this.data = new LinkedList<Map<String, Object>>();
}

From source file:com.matthewmitchell.peercoin_android_wallet.ui.WalletAddressFragment.java

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

    this.activity = (WalletActivity) activity;
    this.application = (WalletApplication) activity.getApplication();
    this.loaderManager = getLoaderManager();
    final NfcManager nfcManager = (NfcManager) activity.getSystemService(Context.NFC_SERVICE);
    this.nfcAdapter = nfcManager.getDefaultAdapter();
}

From source file:de.schildbach.wallet.ui.RequestCoinsFragment.java

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

    this.activity = (AbstractWalletActivity) activity;
    this.application = (WalletApplication) activity.getApplication();
    this.nfcManager = (NfcManager) activity.getSystemService(Context.NFC_SERVICE);
    this.clipboardManager = (ClipboardManager) activity.getSystemService(Context.CLIPBOARD_SERVICE);
}

From source file:com.feathercoin.wallet.feathercoin.ui.RequestCoinsFragment.java

@SuppressLint("InlinedApi")
@Override/*from w ww.  j a va  2  s.  c o m*/
public void onAttach(final Activity activity) {
    super.onAttach(activity);
    this.activity = (AbstractWalletActivity) activity;
    application = (WalletApplication) activity.getApplication();

    nfcManager = activity.getSystemService(Context.NFC_SERVICE);
    clipboardManager = (android.text.ClipboardManager) activity.getSystemService(Context.CLIPBOARD_SERVICE);
}