Example usage for android.nfc NfcAdapter disableForegroundDispatch

List of usage examples for android.nfc NfcAdapter disableForegroundDispatch

Introduction

In this page you can find the example usage for android.nfc NfcAdapter disableForegroundDispatch.

Prototype

public void disableForegroundDispatch(Activity activity) 

Source Link

Document

Disable foreground dispatch to the given activity.

Usage

From source file:com.dimasdanz.kendalipintu.NFCOpenDoorActivity.java

public static void stopForegroundDispatch(final Activity activity, NfcAdapter adapter) {
    adapter.disableForegroundDispatch(activity);
}

From source file:de.uni_koblenz_landau.apow.LoginActivity.java

/**
 * Stop scanning for NFC tags./*from  www.  j  a  va2  s . c om*/
  * @param activity The Activity requesting to the foreground dispatch.
  * @param adapter The NfcAdapter used for the foreground dispatch.
 */
private static void stopForegroundDispatch(final Activity activity, NfcAdapter adapter) {
    if (adapter != null) {
        adapter.disableForegroundDispatch(activity);
    }
}

From source file:it.imwatch.nfclottery.MainActivity.java

/**
 * Stops the dispatching of NFC events for a foreground Activity.
 *
 * @param activity The {@link android.app.Activity} to stop the foreground dispatch for
 * @param adapter  The {@link android.nfc.NfcAdapter} to stop the foreground dispatch for
 *//*from   w ww .j av a  2 s .  c  o  m*/
public static void stopForegroundDispatch(final Activity activity, NfcAdapter adapter) {
    if (adapter != null) {
        adapter.disableForegroundDispatch(activity);
    }
}

From source file:io.atrac613.AbstractNfcTagFragment.java

@Override
public void onPause() {
    Log.d(TAG, "*** AbstractNfcFeliCaTagFragment go Pause");
    if (this.getActivity().isFinishing()) {
        Log.d(TAG, "*** AbstractNfcFeliCaTagFragment will finishing");
        NfcAdapter adapter = NfcAdapter.getDefaultAdapter(this.getActivity());
        adapter.disableForegroundDispatch(this.getActivity());
        sTechList = null;// w w w . j  ava 2  s . c om
    }
    super.onPause();
}

From source file:com.tananaev.passportreader.MainActivity.java

@Override
protected void onPause() {
    super.onPause();

    NfcAdapter adapter = NfcAdapter.getDefaultAdapter(this);
    adapter.disableForegroundDispatch(this);
}

From source file:com.geecko.QuickLyric.MainActivity.java

@Override
protected void onPause() {
    super.onPause();
    App.activityPaused();// w w w  .  ja v  a 2  s . c om
    if (receiver != null && receiverRegistered) {
        unregisterReceiver(receiver);
        LocalBroadcastManager.getInstance(this).unregisterReceiver(receiver);
        receiverRegistered = false;
    }
    NfcAdapter nfcAdapter = NfcAdapter.getDefaultAdapter(this);
    if (nfcAdapter != null)
        nfcAdapter.disableForegroundDispatch(this);
    AppBarLayout appBarLayout = (AppBarLayout) findViewById(id.appbar);
    appBarLayout.removeOnOffsetChangedListener(this);
}