Lines Matching refs:activity

57      * Intent to start an activity when a tag with NDEF payload is discovered.
64 * most specific intent filters possible to avoid the activity chooser dialog, which can
78 * Intent to start an activity when a tag is discovered and activities are registered for the
81 * <p>To receive this intent an activity must include an intent filter
85 * &lt;activity android:name=".nfc.TechFilter" android:label="NFC/TechFilter"&gt;
94 * &lt;/activity&gt;</pre>
103 * activity is considered a match is any single <code>tech-list</code> matches the tag that was
134 * Intent to start an activity when a tag is discovered.
143 * Broadcast to only the activity that handles ACTION_TAG_DISCOVERED
293 * on top of your activity during this time, so do not try to request
602 * specified activity(s) are in resumed (foreground) state. The recommended
614 * then the Uri push will be completely disabled for the specified activity(s).
624 * And that is it. Only one call per activity is necessary. The Android
642 * @param activity activity for which the Uri(s) will be pushed
644 public void setBeamPushUris(Uri[] uris, Activity activity) {
645 if (activity == null) {
646 throw new NullPointerException("activity cannot be null");
660 mNfcActivityManager.setNdefPushContentUri(activity, uris);
682 * specified activity(s) are in resumed (foreground) state. The recommended
694 * then the Uri push will be completely disabled for the specified activity(s).
704 * And that is it. Only one call per activity is necessary. The Android
718 * @param activity activity for which the Uri(s) will be pushed
720 public void setBeamPushUrisCallback(CreateBeamUrisCallback callback, Activity activity) {
721 if (activity == null) {
722 throw new NullPointerException("activity cannot be null");
724 mNfcActivityManager.setNdefPushContentUriCallback(activity, callback);
732 * specified activity(s) are in resumed (foreground) state. The recommended
738 * <p>Only one NDEF message can be pushed by the currently resumed activity.
744 * {@link #setNdefPushMessageCallback} have been called for your activity, then
750 * then NDEF push will be completely disabled for the specified activity(s).
752 * otherwise sent on your behalf for those activity(s).
766 * and to do so during the activity's {@link Activity#onCreate}. For example:
774 * And that is it. Only one call per activity is necessary. The Android
793 * @param activity activity for which the NDEF message will be pushed
795 * to only register one at a time, and to do so in that activity's
798 public void setNdefPushMessage(NdefMessage message, Activity activity,
802 if (activity == null) {
803 throw new NullPointerException("activity cannot be null");
805 mNfcActivityManager.setNdefPushMessage(activity, message);
829 * specified activity(s) are in resumed (foreground) state. The recommended
835 * <p>Only one NDEF message can be pushed by the currently resumed activity.
841 * {@link #setNdefPushMessageCallback} have been called for your activity, then
847 * then NDEF push will be completely disabled for the specified activity(s).
849 * otherwise sent on your behalf for those activity(s).
863 * and to do so during the activity's {@link Activity#onCreate}. For example:
871 * And that is it. Only one call per activity is necessary. The Android
884 * @param activity activity for which the NDEF message will be pushed
886 * to only register one at a time, and to do so in that activity's
889 public void setNdefPushMessageCallback(CreateNdefMessageCallback callback, Activity activity,
893 if (activity == null) {
894 throw new NullPointerException("activity cannot be null");
896 mNfcActivityManager.setNdefPushMessageCallback(activity, callback);
920 * specified activity(s) are in resumed (foreground) state. The recommended
928 * and to do so during the activity's {@link Activity#onCreate}. For example:
936 * And that is it. Only one call per activity is necessary. The Android
947 * @param activity activity for which the NDEF message will be pushed
949 * to only register one at a time, and to do so in that activity's
953 Activity activity, Activity ... activities) {
956 if (activity == null) {
957 throw new NullPointerException("activity cannot be null");
959 mNfcActivityManager.setOnNdefPushCompleteCallback(activity, callback);
981 * <p>This will give give priority to the foreground activity when
994 * that acts a wild card and will cause the foreground activity to receive all tags via the
997 * <p>This method must be called from the main thread, and only when the activity is in the
1004 * @param activity the Activity to dispatch to
1011 public void enableForegroundDispatch(Activity activity, PendingIntent intent,
1013 if (activity == null || intent == null) {
1016 if (!activity.isResumed()) {
1018 "when your activity is resumed");
1025 ActivityThread.currentActivityThread().registerOnActivityPausedListener(activity,
1034 * Disable foreground dispatch to the given activity.
1036 * <p>After calling {@link #enableForegroundDispatch}, an activity
1044 * @param activity the Activity to disable dispatch to
1047 public void disableForegroundDispatch(Activity activity) {
1048 ActivityThread.currentActivityThread().unregisterOnActivityPausedListener(activity,
1050 disableForegroundDispatchInternal(activity, false);
1055 public void onPaused(Activity activity) {
1056 disableForegroundDispatchInternal(activity, true);
1060 void disableForegroundDispatchInternal(Activity activity, boolean force) {
1063 if (!force && !activity.isResumed()) {
1065 "while your activity is still resumed");
1075 * <p>You must explicitly call this method every time the activity is
1077 * your activity completes {@link Activity#onPause}.
1080 * instead: it automatically hooks into your activity life-cycle,
1093 * @param activity foreground activity
1095 * @throws IllegalStateException if the activity is not currently in the foreground
1099 public void enableForegroundNdefPush(Activity activity, NdefMessage message) {
1100 if (activity == null || message == null) {
1103 enforceResumed(activity);
1104 mNfcActivityManager.setNdefPushMessage(activity, message);
1110 * <p>After calling {@link #enableForegroundNdefPush}, an activity
1115 * instead: it automatically hooks into your activity life-cycle,
1122 * @param activity the Foreground activity
1127 public void disableForegroundNdefPush(Activity activity) {
1128 if (activity == null) {
1131 enforceResumed(activity);
1132 mNfcActivityManager.setNdefPushMessage(activity, null);
1133 mNfcActivityManager.setNdefPushMessageCallback(activity, null);
1134 mNfcActivityManager.setOnNdefPushCompleteCallback(activity, null);
1242 void enforceResumed(Activity activity) {
1243 if (!activity.isResumed()) {
1244 throw new IllegalStateException("API cannot be called while activity is paused");