/development/samples/devbytes/telephony/SmsSampleProject/app/src/main/java/com/example/android/smssample/receiver/ |
D | MessagingReceiver.java | 35 public void onReceive(Context context, Intent intent) { in onReceive() argument 36 String action = intent == null ? null : intent.getAction(); in onReceive() 41 handleIncomingSms(context, intent); in onReceive() 43 handleIncomingMms(context, intent); in onReceive() 47 handleIncomingSms(context, intent); in onReceive() 49 handleIncomingMms(context, intent); in onReceive() 54 private void handleIncomingSms(Context context, Intent intent) { in handleIncomingSms() argument 57 intent.setAction(MessagingService.ACTION_MY_RECEIVE_SMS); in handleIncomingSms() 58 intent.setClass(context, MessagingService.class); in handleIncomingSms() 59 startWakefulService(context, intent); in handleIncomingSms() [all …]
|
/development/samples/MultiWindow/src/com/example/android/multiwindow/ |
D | LaunchingAdjacentActivity.java | 53 Intent intent = new Intent("android.settings.SETTINGS"); in onClick() local 54 intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK in onClick() 56 startActivity(intent); in onClick() 60 Intent intent = newAdjacentActivityIntent(); in onClick() local 61 intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); in onClick() 62 startActivity(intent); in onClick() 66 Intent intent = newAdjacentActivityIntent(); in onClick() local 67 intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_MULTIPLE_TASK); in onClick() 68 startActivity(intent); in onClick() 72 Intent intent = newAdjacentActivityIntent(); in onClick() local [all …]
|
/development/samples/ApiDemos/src/com/example/android/apis/content/ |
D | DocumentsSample.java | 83 Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT); in onCreate() 84 intent.addCategory(Intent.CATEGORY_OPENABLE); in onCreate() 85 intent.setType("*/*"); in onCreate() 87 intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true); in onCreate() 90 intent.putExtra(Intent.EXTRA_LOCAL_ONLY, true); in onCreate() 92 startActivityForResult(intent, CODE_READ); in onCreate() 102 Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT); in onCreate() 103 intent.addCategory(Intent.CATEGORY_OPENABLE); in onCreate() 104 intent.setType("image/*"); in onCreate() 106 intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true); in onCreate() [all …]
|
D | InstallApk.java | 70 public void onActivityResult(int requestCode, int resultCode, Intent intent) { in onActivityResult() argument 92 Intent intent = new Intent(Intent.ACTION_INSTALL_PACKAGE); 93 intent.setData(getApkUri("HelloActivity.apk")); 94 intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); 95 startActivity(intent); 101 Intent intent = new Intent(Intent.ACTION_INSTALL_PACKAGE); 102 intent.setData(getApkUri("HelloActivity.apk")); 103 intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); 104 intent.putExtra(Intent.EXTRA_NOT_UNKNOWN_SOURCE, true); 105 intent.putExtra(Intent.EXTRA_RETURN_RESULT, true); [all …]
|
/development/samples/ApiDemos/src/com/example/android/apis/app/ |
D | Intents.java | 37 Intent intent = new Intent(Intent.ACTION_GET_CONTENT); in onGetMusic() local 38 intent.setType("audio/*"); in onGetMusic() 39 startActivity(Intent.createChooser(intent, "Select music")); in onGetMusic() 43 Intent intent = new Intent(Intent.ACTION_GET_CONTENT); in onGetImage() local 44 intent.setType("image/*"); in onGetImage() 45 startActivity(Intent.createChooser(intent, "Select image")); in onGetImage() 49 Intent intent = new Intent(Intent.ACTION_GET_CONTENT); in onGetStream() local 50 intent.setType("*/*"); in onGetStream() 51 startActivity(Intent.createChooser(intent, "Select stream")); in onGetStream()
|
D | ForegroundService.java | 80 public int onStartCommand(Intent intent, int flags, int startId) { in onStartCommand() argument 81 final boolean usingWakelock = ACTION_FOREGROUND_WAKELOCK.equals(intent.getAction()); in onStartCommand() 82 if (ACTION_FOREGROUND.equals(intent.getAction()) || usingWakelock) { in onStartCommand() 106 } else if (ACTION_BACKGROUND.equals(intent.getAction()) in onStartCommand() 107 || ACTION_BACKGROUND_WAKELOCK.equals(intent.getAction())) { in onStartCommand() 111 if (ACTION_FOREGROUND_WAKELOCK.equals(intent.getAction()) in onStartCommand() 112 || ACTION_BACKGROUND_WAKELOCK.equals(intent.getAction())) { in onStartCommand() 143 public IBinder onBind(Intent intent) { in onBind() argument 183 Intent intent = new Intent(ForegroundService.ACTION_FOREGROUND); 184 intent.setClass(Controller.this, ForegroundService.class); [all …]
|
D | LauncherShortcuts.java | 62 final Intent intent = getIntent(); in onCreate() local 63 final String action = intent.getAction(); in onCreate() 83 String info = intent.toString(); in onCreate() 84 String extra = intent.getStringExtra(EXTRA_KEY); in onCreate() 130 Intent intent = new Intent(); in setupShortcut() local 131 intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent); in setupShortcut() 132 intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, getString(R.string.shortcut_name)); in setupShortcut() 135 intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, iconResource); in setupShortcut() 139 setResult(RESULT_OK, intent); in setupShortcut()
|
D | IntentActivityFlags.java | 52 Intent intent = new Intent(Intent.ACTION_MAIN); in buildIntentsToViewsLists() local 53 intent.setClass(IntentActivityFlags.this, com.example.android.apis.ApiDemos.class); in buildIntentsToViewsLists() 54 intent.putExtra("com.example.android.apis.Path", "Views"); in buildIntentsToViewsLists() 55 intents[1] = intent; in buildIntentsToViewsLists() 57 intent = new Intent(Intent.ACTION_MAIN); in buildIntentsToViewsLists() 58 intent.setClass(IntentActivityFlags.this, com.example.android.apis.ApiDemos.class); in buildIntentsToViewsLists() 59 intent.putExtra("com.example.android.apis.Path", "Views/Lists"); in buildIntentsToViewsLists() 61 intents[2] = intent; in buildIntentsToViewsLists()
|
/development/samples/ApiDemos/src/com/example/android/apis/media/ |
D | MediaPlayerDemo.java | 60 Intent intent = 63 intent.putExtra(MEDIA, LOCAL_AUDIO); 64 startActivity(intent); 70 Intent intent = 73 intent.putExtra(MEDIA, RESOURCES_AUDIO); 74 startActivity(intent); 81 Intent intent = 84 intent.putExtra(MEDIA, LOCAL_VIDEO); 85 startActivity(intent); 91 Intent intent = [all …]
|
/development/samples/Home/src/com/example/android/home/ |
D | ApplicationInfo.java | 36 Intent intent; field in ApplicationInfo 55 intent = new Intent(Intent.ACTION_MAIN); in setActivity() 56 intent.addCategory(Intent.CATEGORY_LAUNCHER); in setActivity() 57 intent.setComponent(className); in setActivity() 58 intent.setFlags(launchFlags); in setActivity() 72 intent.getComponent().getClassName().equals( in equals() 73 that.intent.getComponent().getClassName()); in equals() 80 final String name = intent.getComponent().getClassName(); in hashCode()
|
/development/samples/browseable/MediaRouter/src/com.example.android.mediarouter/provider/ |
D | SampleMediaRouteProvider.java | 285 public boolean onControlRequest(Intent intent, ControlRequestCallback callback) { in onControlRequest() argument 286 Log.d(TAG, mRouteId + ": Received control request " + intent); in onControlRequest() 287 String action = intent.getAction(); in onControlRequest() 288 if (intent.hasCategory(MediaControlIntent.CATEGORY_REMOTE_PLAYBACK)) { in onControlRequest() 291 success = handlePlay(intent, callback); in onControlRequest() 293 success = handleEnqueue(intent, callback); in onControlRequest() 295 success = handleRemove(intent, callback); in onControlRequest() 297 success = handleSeek(intent, callback); in onControlRequest() 299 success = handleGetStatus(intent, callback); in onControlRequest() 301 success = handlePause(intent, callback); in onControlRequest() [all …]
|
/development/samples/StackWidget/src/com/example/android/stackwidget/ |
D | StackWidgetProvider.java | 48 public void onReceive(Context context, Intent intent) { in onReceive() argument 50 if (intent.getAction().equals(TOAST_ACTION)) { in onReceive() 51 int appWidgetId = intent.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, in onReceive() 53 int viewIndex = intent.getIntExtra(EXTRA_ITEM, 0); in onReceive() 56 super.onReceive(context, intent); in onReceive() 66 Intent intent = new Intent(context, StackWidgetService.class); in onUpdate() local 67 intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetIds[i]); in onUpdate() 70 intent.setData(Uri.parse(intent.toUri(Intent.URI_INTENT_SCHEME))); in onUpdate() 72 rv.setRemoteAdapter(appWidgetIds[i], R.id.stack_view, intent); in onUpdate() 85 intent.setData(Uri.parse(intent.toUri(Intent.URI_INTENT_SCHEME))); in onUpdate()
|
/development/samples/ReceiveShareDemo/src/com/example/android/receiveshare/ |
D | ReceiveShare.java | 35 static Uri getShareUri(Intent intent) { in getShareUri() argument 36 Uri uri = intent.getParcelableExtra(Intent.EXTRA_STREAM); in getShareUri() 38 ClipData clip = intent.getClipData(); in getShareUri() 46 static CharSequence buildShareInfo(ContentResolver resolver, Intent intent) { in buildShareInfo() argument 48 if (intent.getType() != null) { in buildShareInfo() 49 sb.append("Type: "); sb.append(intent.getType()); sb.append("\n"); in buildShareInfo() 51 CharSequence text = intent.getCharSequenceExtra(Intent.EXTRA_TEXT); in buildShareInfo() 54 String html = intent.getStringExtra(Intent.EXTRA_HTML_TEXT); in buildShareInfo() 59 Uri uri = getShareUri(intent); in buildShareInfo() 105 Intent intent = new Intent(ReceiveShare.this, ReceiveShareService.class); in onCreate() [all …]
|
/development/samples/browseable/XYZTouristAttractions/Wearable/src/com.example.android.xyztouristattractions/service/ |
D | UtilityService.java | 54 Intent intent = new Intent(context, UtilityService.class); in clearNotification() local 55 intent.setAction(UtilityService.ACTION_CLEAR_NOTIFICATION); in clearNotification() 56 context.startService(intent); in clearNotification() 64 Intent intent = new Intent(context, UtilityService.class); in getClearRemoteNotificationsIntent() local 65 intent.setAction(UtilityService.ACTION_CLEAR_REMOTE_NOTIFICATIONS); in getClearRemoteNotificationsIntent() 66 return intent; in getClearRemoteNotificationsIntent() 78 Intent intent = new Intent(context, UtilityService.class); in startDeviceActivity() local 79 intent.setAction(UtilityService.ACTION_START_DEVICE_ACTIVITY); in startDeviceActivity() 86 intent.putExtra(EXTRA_START_ACTIVITY_INFO, extraInfo); in startDeviceActivity() 87 intent.putExtra(EXTRA_START_PATH, path); in startDeviceActivity() [all …]
|
/development/samples/ShortcutSample/src/com/example/android/shortcutsample/ |
D | MyReceiver.java | 32 public void onReceive(Context context, Intent intent) { in onReceive() argument 33 Log.i(TAG, "onReceive: " + intent); in onReceive() 34 if (Intent.ACTION_LOCALE_CHANGED.equals(intent.getAction())) { in onReceive() 38 } else if (ACTION_PIN_REQUEST_ACCEPTED.equals(intent.getAction())) { in onReceive() 45 final Intent intent = new Intent(ACTION_PIN_REQUEST_ACCEPTED); in getPinRequestAcceptedIntent() local 46 intent.setComponent(new ComponentName(context, MyReceiver.class)); in getPinRequestAcceptedIntent() 48 return PendingIntent.getBroadcast(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); in getPinRequestAcceptedIntent()
|
/development/cmds/monkey/src/com/android/commands/monkey/ |
D | MonkeyActivityEvent.java | 62 Intent intent = new Intent(Intent.ACTION_MAIN); in getEvent() local 64 intent.addCategory(mMainApps.get(mApp)); in getEvent() 66 intent.addCategory(Intent.CATEGORY_LAUNCHER); in getEvent() 68 intent.setComponent(mApp); in getEvent() 69 intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); in getEvent() 70 return intent; in getEvent() 75 Intent intent = getEvent(); in injectEvent() local 77 Logger.out.println(":Switch: " + intent.toUri(0)); in injectEvent() 83 intent.putExtras(args); in injectEvent() 87 iam.startActivityAsUserWithFeature(null, getPackageName(), null, intent, null, null, in injectEvent() [all …]
|
/development/samples/training/notify-user/src/com/example/android/pingme/ |
D | ResultActivity.java | 39 Intent intent = new Intent(getApplicationContext(), PingService.class); in onSnoozeClick() local 40 intent.setAction(CommonConstants.ACTION_SNOOZE); in onSnoozeClick() 41 startService(intent); in onSnoozeClick() 45 Intent intent = new Intent(getApplicationContext(), PingService.class); in onDismissClick() local 46 intent.setAction(CommonConstants.ACTION_DISMISS); in onDismissClick() 47 startService(intent); in onDismissClick()
|
/development/samples/devbytes/telephony/SmsSampleProject/app/src/main/java/com/example/android/smssample/service/ |
D | MessagingService.java | 42 protected void onHandleIntent(Intent intent) { in onHandleIntent() argument 43 if (intent != null) { in onHandleIntent() 44 String intentAction = intent.getAction(); in onHandleIntent() 49 MessagingReceiver.completeWakefulIntent(intent); in onHandleIntent() 54 MessagingReceiver.completeWakefulIntent(intent); in onHandleIntent()
|
/development/samples/browseable/ShareActionProvider/src/com.example.android.shareactionprovider/content/ |
D | ContentItem.java | 82 Intent intent = new Intent(Intent.ACTION_SEND); in getShareIntent() local 86 intent.setType("image/jpg"); in getShareIntent() 88 intent.putExtra(Intent.EXTRA_STREAM, getContentUri()); in getShareIntent() 92 intent.setType("text/plain"); in getShareIntent() 94 intent.putExtra(Intent.EXTRA_TEXT, context.getString(contentResourceId)); in getShareIntent() 98 return intent; in getShareIntent()
|
/development/samples/browseable/Notifications/Application/src/com.example.android.support.wearable.notifications/ |
D | NotificationIntentReceiver.java | 40 public void onReceive(Context context, Intent intent) { in onReceive() argument 41 if (intent.getAction().equals(ACTION_EXAMPLE)) { in onReceive() 43 String message = intent.getStringExtra(NotificationUtil.EXTRA_MESSAGE); in onReceive() 44 Bundle remoteInputResults = RemoteInput.getResultsFromIntent(intent); in onReceive() 54 } else if (intent.getAction().equals(ACTION_ENABLE_MESSAGES)) { in onReceive() 56 } else if (intent.getAction().equals(ACTION_DISABLE_MESSAGES)) { in onReceive()
|
/development/samples/browseable/DirectShare/src/com.example.android.directshare/ |
D | SendMessageActivity.java | 102 private boolean resolveIntent(Intent intent) { in resolveIntent() argument 103 if (Intent.ACTION_SEND.equals(intent.getAction()) && in resolveIntent() 104 "text/plain".equals(intent.getType())) { in resolveIntent() 105 mBody = intent.getStringExtra(Intent.EXTRA_TEXT); in resolveIntent() 106 mContactId = intent.getIntExtra(Contact.ID, Contact.INVALID_ID); in resolveIntent() 127 Intent intent = new Intent(this, SelectContactActivity.class); in selectContact() local 128 intent.setAction(SelectContactActivity.ACTION_SELECT_CONTACT); in selectContact() 129 startActivityForResult(intent, REQUEST_SELECT_CONTACT); in selectContact()
|
/development/samples/browseable/MultiWindowPlayground/src/com/android.multiwindowplayground/ |
D | MainActivity.java | 59 Intent intent = new Intent(this, UnresizableActivity.class); in onStartUnresizableClick() local 60 intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); in onStartUnresizableClick() 61 startActivity(intent); in onStartUnresizableClick() 80 Intent intent = new Intent(this, AdjacentActivity.class); in onStartAdjacentActivity() local 81 intent.addFlags(Intent.FLAG_ACTIVITY_LAUNCH_ADJACENT | Intent.FLAG_ACTIVITY_NEW_TASK); in onStartAdjacentActivity() 82 startActivity(intent); in onStartAdjacentActivity() 96 Intent intent = new Intent(this, LaunchBoundsActivity.class); in onStartLaunchBoundsActivity() local 97 startActivity(intent, options.toBundle()); in onStartLaunchBoundsActivity()
|
/development/samples/browseable/ElizaChat/src/com.example.android.wearable.elizachat/ |
D | ResponderService.java | 67 public IBinder onBind(Intent intent) { in onBind() argument 72 public int onStartCommand(Intent intent, int flags, int startId) { in onStartCommand() argument 73 if (null == intent || null == intent.getAction()) { in onStartCommand() 76 String action = intent.getAction(); in onStartCommand() 78 Bundle remoteInputResults = RemoteInput.getResultsFromIntent(intent); in onStartCommand() 101 Intent intent = new Intent(ACTION_RESPONSE); in showNotification() local 102 PendingIntent pendingIntent = PendingIntent.getService(this, 0, intent, in showNotification() 134 Intent intent = new Intent(MainActivity.ACTION_NOTIFY); in broadcastMessage() local 135 intent.putExtra(MainActivity.EXTRA_MESSAGE, message); in broadcastMessage() 136 mBroadcastManager.sendBroadcast(intent); in broadcastMessage()
|
/development/samples/ApiDemos/src/com/example/android/apis/nfc/ |
D | TechFilter.java | 38 Intent intent = getIntent(); in onCreate() local 39 String action = intent.getAction(); in onCreate() 41 mText.setText("Discovered tag " + ++mCount + " with intent: " + intent); in onCreate() 48 public void onNewIntent(Intent intent) { in onNewIntent() argument 49 mText.setText("Discovered tag " + ++mCount + " with intent: " + intent); in onNewIntent()
|
/development/apps/CustomLocale/src/com/android/customlocale2/ |
D | CustomLocaleReceiver.java | 48 public void onReceive(Context context, Intent intent) { in onReceive() argument 50 if (intent == null || ! ACTION_SET_LOCALE.equals(intent.getAction())) { in onReceive() 52 Log.d(TAG, "Invalid intent: " + (intent == null ? "null" : intent.toString())); in onReceive() 57 String locale = intent.getStringExtra(EXTRA_LOCALE); in onReceive()
|