Java Code Examples for android.nfc.NfcAdapter#disableForegroundDispatch()

The following examples show how to use android.nfc.NfcAdapter#disableForegroundDispatch() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PGPClipperResultShowActivity.java    From PGPClipper with Apache License 2.0 5 votes vote down vote up
private void disableTagReading(NfcAdapter adapter) {
    try {
        adapter.disableForegroundDispatch(this);
    } catch (Exception e) {
        // ignore
    }

}
 
Example 2
Source File: PGPClipperQuickReplyActivity.java    From PGPClipper with Apache License 2.0 5 votes vote down vote up
private void disableTagReading(NfcAdapter adapter) {
    try {
        adapter.disableForegroundDispatch(this);
    } catch (Exception e) {
        // ignore
    }

}
 
Example 3
Source File: MainActivity.java    From QuickLyric with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void onPause() {
    super.onPause();
    NfcAdapter nfcAdapter = NfcAdapter.getDefaultAdapter(this);
    if (nfcAdapter != null)
        nfcAdapter.disableForegroundDispatch(this);
    AppBarLayout appBarLayout = findViewById(id.appbar);
    appBarLayout.removeOnOffsetChangedListener(this);
}
 
Example 4
Source File: ActivityAddFriend.java    From ploggy with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onPause() {
    super.onPause();
    NfcAdapter nfcAdapter = getNfcAdapter();
    if (nfcAdapter != null) {
        nfcAdapter.disableForegroundDispatch(this);
    }
}
 
Example 5
Source File: TagDispatcher.java    From GreenBits with GNU General Public License v3.0 4 votes vote down vote up
private void disableForegroundDispatch(NfcAdapter adapter) {
    adapter.disableForegroundDispatch(activity);
}
 
Example 6
Source File: NFCAuthenticationSetupActivity.java    From PGPClipper with Apache License 2.0 4 votes vote down vote up
private void disableTagReading(NfcAdapter adapter) {
    adapter.disableForegroundDispatch(this);
}
 
Example 7
Source File: TagDispatcher.java    From nordpol with MIT License 4 votes vote down vote up
private void disableForegroundDispatch(NfcAdapter adapter) {
    adapter.disableForegroundDispatch(activity);
}
 
Example 8
Source File: TagDispatcher.java    From WalletCordova with GNU Lesser General Public License v2.1 4 votes vote down vote up
private void disableForegroundDispatch(NfcAdapter adapter) {
    adapter.disableForegroundDispatch(activity);
}
 
Example 9
Source File: PassportConActivity.java    From polling-station-app with GNU Lesser General Public License v3.0 2 votes vote down vote up
/**
 * @param activity The corresponding {@link BaseActivity} requesting to stop the foreground dispatch.
 * @param adapter The {@link NfcAdapter} used for the foreground dispatch.
 */
public static void stopForegroundDispatch(final Activity activity, NfcAdapter adapter) {
    adapter.disableForegroundDispatch(activity);
}
 
Example 10
Source File: Abbott.java    From FreeStyleLibre-NFC-Reader with GNU General Public License v3.0 2 votes vote down vote up
/**
 * @param activity The corresponding {@link BaseActivity} requesting to stop the foreground dispatch.
 * @param adapter The {@link NfcAdapter} used for the foreground dispatch.
 */
public static void stopForegroundDispatch(final Activity activity, NfcAdapter adapter) {
    adapter.disableForegroundDispatch(activity);
}