/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/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/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/ApiDemos/src/com/example/android/apis/app/ |
D | ForegroundService.java | 85 public int onStartCommand(Intent intent, int flags, int startId) { in onStartCommand() argument 86 if (ACTION_FOREGROUND.equals(intent.getAction()) in onStartCommand() 87 || ACTION_FOREGROUND_WAKELOCK.equals(intent.getAction())) { 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 | 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 | 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/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/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/cmds/monkey/src/com/android/commands/monkey/ |
D | MonkeyActivityEvent.java | 49 Intent intent = new Intent(Intent.ACTION_MAIN); in getEvent() local 50 intent.addCategory(Intent.CATEGORY_LAUNCHER); in getEvent() 51 intent.setComponent(mApp); in getEvent() 52 intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); in getEvent() 53 return intent; in getEvent() 58 Intent intent = getEvent(); in injectEvent() local 60 Logger.out.println(":Switch: " + intent.toUri(0)); in injectEvent() 66 intent.putExtras(args); in injectEvent() 70 iam.startActivityAsUser(null, null, intent, null, null, null, 0, in injectEvent() 78 + intent.toUri(0)); in injectEvent()
|
/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/XYZTouristAttractions/Application/src/com.example.android.xyztouristattractions/service/ |
D | UtilityService.java | 87 Intent intent = new Intent(context, UtilityService.class); in triggerWearTest() local 88 intent.setAction(UtilityService.ACTION_FAKE_UPDATE); in triggerWearTest() 89 intent.putExtra(EXTRA_TEST_MICROAPP, microApp); in triggerWearTest() 90 context.startService(intent); in triggerWearTest() 94 Intent intent = new Intent(context, UtilityService.class); in addGeofences() local 95 intent.setAction(UtilityService.ACTION_ADD_GEOFENCES); in addGeofences() 96 context.startService(intent); in addGeofences() 100 Intent intent = new Intent(context, UtilityService.class); in requestLocation() local 101 intent.setAction(UtilityService.ACTION_REQUEST_LOCATION); in requestLocation() 102 context.startService(intent); in requestLocation() [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/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/AppNavigation/src/com/example/android/appnavigation/app/ |
D | AppNavHomeActivity.java | 47 startActivity(info.intent); in onListItemClick() 51 Intent intent = new Intent(Intent.ACTION_MAIN, null); in querySampleActivities() local 52 intent.setPackage(getPackageName()); in querySampleActivities() 53 intent.addCategory(Intent.CATEGORY_SAMPLE_CODE); in querySampleActivities() 56 List<ResolveInfo> infos = pm.queryIntentActivities(intent, 0); in querySampleActivities() 78 Intent intent; field in AppNavHomeActivity.SampleInfo 80 SampleInfo(String name, Intent intent) { in SampleInfo() argument 82 this.intent = intent; in SampleInfo()
|
/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/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/SampleSyncAdapter/src/com/example/android/samplesync/authenticator/ |
D | AuthenticatorActivity.java | 101 final Intent intent = getIntent(); in onCreate() local 102 mUsername = intent.getStringExtra(PARAM_USERNAME); in onCreate() 104 mConfirmCredentials = intent.getBooleanExtra(PARAM_CONFIRM_CREDENTIALS, false); in onCreate() 175 final Intent intent = new Intent(); in finishConfirmCredentials() local 176 intent.putExtra(AccountManager.KEY_BOOLEAN_RESULT, result); in finishConfirmCredentials() 177 setAccountAuthenticatorResult(intent.getExtras()); in finishConfirmCredentials() 178 setResult(RESULT_OK, intent); in finishConfirmCredentials() 202 final Intent intent = new Intent(); in finishLogin() local 203 intent.putExtra(AccountManager.KEY_ACCOUNT_NAME, mUsername); in finishLogin() 204 intent.putExtra(AccountManager.KEY_ACCOUNT_TYPE, Constants.ACCOUNT_TYPE); in finishLogin() [all …]
|
/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/WearNotifications/Application/src/com.example.android.wearable.wear.wearnotifications/handlers/ |
D | BigPictureSocialIntentService.java | 56 protected void onHandleIntent(Intent intent) { in onHandleIntent() argument 57 Log.d(TAG, "onHandleIntent(): " + intent); in onHandleIntent() 59 if (intent != null) { in onHandleIntent() 60 final String action = intent.getAction(); in onHandleIntent() 62 handleActionComment(getMessage(intent)); in onHandleIntent() 121 private CharSequence getMessage(Intent intent) { in getMessage() argument 122 Bundle remoteInput = RemoteInput.getResultsFromIntent(intent); in getMessage() 182 Intent intent = new Intent(this, BigPictureSocialIntentService.class); in recreateBuilderWithBigPictureStyle() local 183 intent.setAction(BigPictureSocialIntentService.ACTION_COMMENT); in recreateBuilderWithBigPictureStyle() 184 replyActionPendingIntent = PendingIntent.getService(this, 0, intent, 0); in recreateBuilderWithBigPictureStyle()
|