Lines Matching refs:activity

64      * Intent to start an activity when a tag with NDEF payload is discovered.
71 * most specific intent filters possible to avoid the activity chooser dialog, which can
85 * Intent to start an activity when a tag is discovered and activities are registered for the
88 * <p>To receive this intent an activity must include an intent filter
92 * &lt;activity android:name=".nfc.TechFilter" android:label="NFC/TechFilter"&gt;
101 * &lt;/activity&gt;</pre>
110 * activity is considered a match is any single <code>tech-list</code> matches the tag that was
141 * Intent to start an activity when a tag is discovered.
150 * Broadcast to only the activity that handles ACTION_TAG_DISCOVERED
324 * A callback to be invoked when the system finds a tag while the foreground activity is
377 * on top of your activity during this time, so do not try to request
800 * specified activity(s) are in resumed (foreground) state. The recommended
812 * then the Uri push will be completely disabled for the specified activity(s).
822 * And that is it. Only one call per activity is necessary. The Android
840 * @param activity activity for which the Uri(s) will be pushed
842 public void setBeamPushUris(Uri[] uris, Activity activity) {
843 if (activity == null) {
844 throw new NullPointerException("activity cannot be null");
858 mNfcActivityManager.setNdefPushContentUri(activity, uris);
880 * specified activity(s) are in resumed (foreground) state. The recommended
892 * then the Uri push will be completely disabled for the specified activity(s).
902 * And that is it. Only one call per activity is necessary. The Android
916 * @param activity activity for which the Uri(s) will be pushed
918 public void setBeamPushUrisCallback(CreateBeamUrisCallback callback, Activity activity) {
919 if (activity == null) {
920 throw new NullPointerException("activity cannot be null");
922 mNfcActivityManager.setNdefPushContentUriCallback(activity, callback);
930 * specified activity(s) are in resumed (foreground) state. The recommended
936 * <p>Only one NDEF message can be pushed by the currently resumed activity.
942 * {@link #setNdefPushMessageCallback} have been called for your activity, then
948 * then NDEF push will be completely disabled for the specified activity(s).
950 * otherwise sent on your behalf for those activity(s).
964 * and to do so during the activity's {@link Activity#onCreate}. For example:
972 * And that is it. Only one call per activity is necessary. The Android
991 * @param activity activity for which the NDEF message will be pushed
993 * to only register one at a time, and to do so in that activity's
996 public void setNdefPushMessage(NdefMessage message, Activity activity,
1000 if (activity == null) {
1001 throw new NullPointerException("activity cannot be null");
1003 mNfcActivityManager.setNdefPushMessage(activity, message, 0);
1026 public void setNdefPushMessage(NdefMessage message, Activity activity, int flags) {
1027 if (activity == null) {
1028 throw new NullPointerException("activity cannot be null");
1030 mNfcActivityManager.setNdefPushMessage(activity, message, flags);
1038 * specified activity(s) are in resumed (foreground) state. The recommended
1044 * <p>Only one NDEF message can be pushed by the currently resumed activity.
1050 * {@link #setNdefPushMessageCallback} have been called for your activity, then
1056 * then NDEF push will be completely disabled for the specified activity(s).
1058 * otherwise sent on your behalf for those activity(s).
1072 * and to do so during the activity's {@link Activity#onCreate}. For example:
1080 * And that is it. Only one call per activity is necessary. The Android
1093 * @param activity activity for which the NDEF message will be pushed
1095 * to only register one at a time, and to do so in that activity's
1098 public void setNdefPushMessageCallback(CreateNdefMessageCallback callback, Activity activity,
1102 if (activity == null) {
1103 throw new NullPointerException("activity cannot be null");
1105 mNfcActivityManager.setNdefPushMessageCallback(activity, callback, 0);
1127 public void setNdefPushMessageCallback(CreateNdefMessageCallback callback, Activity activity,
1129 if (activity == null) {
1130 throw new NullPointerException("activity cannot be null");
1132 mNfcActivityManager.setNdefPushMessageCallback(activity, callback, flags);
1140 * specified activity(s) are in resumed (foreground) state. The recommended
1148 * and to do so during the activity's {@link Activity#onCreate}. For example:
1156 * And that is it. Only one call per activity is necessary. The Android
1167 * @param activity activity for which the NDEF message will be pushed
1169 * to only register one at a time, and to do so in that activity's
1173 Activity activity, Activity ... activities) {
1176 if (activity == null) {
1177 throw new NullPointerException("activity cannot be null");
1179 mNfcActivityManager.setOnNdefPushCompleteCallback(activity, callback);
1201 * <p>This will give give priority to the foreground activity when
1214 * that acts a wild card and will cause the foreground activity to receive all tags via the
1217 * <p>This method must be called from the main thread, and only when the activity is in the
1224 * @param activity the Activity to dispatch to
1231 public void enableForegroundDispatch(Activity activity, PendingIntent intent,
1233 if (activity == null || intent == null) {
1236 if (!activity.isResumed()) {
1238 "when your activity is resumed");
1245 ActivityThread.currentActivityThread().registerOnActivityPausedListener(activity,
1254 * Disable foreground dispatch to the given activity.
1256 * <p>After calling {@link #enableForegroundDispatch}, an activity
1264 * @param activity the Activity to disable dispatch to
1267 public void disableForegroundDispatch(Activity activity) {
1268 ActivityThread.currentActivityThread().unregisterOnActivityPausedListener(activity,
1270 disableForegroundDispatchInternal(activity, false);
1275 public void onPaused(Activity activity) {
1276 disableForegroundDispatchInternal(activity, true);
1280 void disableForegroundDispatchInternal(Activity activity, boolean force) {
1283 if (!force && !activity.isResumed()) {
1285 "while your activity is still resumed");
1308 * @param activity the Activity that requests the adapter to be in reader mode
1313 public void enableReaderMode(Activity activity, ReaderCallback callback, int flags,
1315 mNfcActivityManager.enableReaderMode(activity, callback, flags, extras);
1323 * @param activity the Activity that currently has reader mode enabled
1325 public void disableReaderMode(Activity activity) {
1326 mNfcActivityManager.disableReaderMode(activity);
1350 * @param activity the current foreground Activity that has registered data to share
1353 public boolean invokeBeam(Activity activity) {
1354 if (activity == null) {
1355 throw new NullPointerException("activity may not be null.");
1357 enforceResumed(activity);
1386 * <p>You must explicitly call this method every time the activity is
1388 * your activity completes {@link Activity#onPause}.
1391 * instead: it automatically hooks into your activity life-cycle,
1404 * @param activity foreground activity
1406 * @throws IllegalStateException if the activity is not currently in the foreground
1410 public void enableForegroundNdefPush(Activity activity, NdefMessage message) {
1411 if (activity == null || message == null) {
1414 enforceResumed(activity);
1415 mNfcActivityManager.setNdefPushMessage(activity, message, 0);
1421 * <p>After calling {@link #enableForegroundNdefPush}, an activity
1426 * instead: it automatically hooks into your activity life-cycle,
1433 * @param activity the Foreground activity
1438 public void disableForegroundNdefPush(Activity activity) {
1439 if (activity == null) {
1442 enforceResumed(activity);
1443 mNfcActivityManager.setNdefPushMessage(activity, null, 0);
1444 mNfcActivityManager.setNdefPushMessageCallback(activity, null, 0);
1445 mNfcActivityManager.setOnNdefPushCompleteCallback(activity, null);
1699 void enforceResumed(Activity activity) {
1700 if (!activity.isResumed()) {
1701 throw new IllegalStateException("API cannot be called while activity is paused");