Best code examples for Android Intent class (android.content.Intent)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android Intent class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Android Intent examples from Open Source projects
This code example shows how to use the following methods: putExtra
134:	Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); 
135:	intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); 
136:	intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.ENGLISH); 
-
140:	intent.putExtra(RecognizerIntent.EXTRA_PROMPT, prompt); 
141:	cordova.startActivityForResult(this, intent, reqCode); 
Full Snippet Info
10
CodeRank
This code example shows how to use the following methods: addFlags, putExtra, setClass, setClipData
27:	Intent intent = new Intent(); 
28:	intent.setClass(Application.getLastInstance(), ChooserActivity.class); 
29:	intent.putExtra(Intent.EXTRA_INTENT, target); 
-
31:	intent.putExtra(Intent.EXTRA_TITLE, title); 
-
50:	intent.setClipData(targetClipData); 
51:	intent.addFlags(permFlags); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: putExtra
77:	ringtonePickerIntent.putExtra( 
-
80:	ringtonePickerIntent.putExtra( 
-
83:	ringtonePickerIntent.putExtra( 
-
87:	ringtonePickerIntent.putExtra( 
-
89:	ringtonePickerIntent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE, 
-
91:	ringtonePickerIntent.putExtra(RingtoneManager.EXTRA_RINGTONE_TITLE, 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: getBooleanExtra, getIntExtra, getParcelableExtra
91:	hasDefaultItem = intent.getBooleanExtra( 
-
94:	.getParcelableExtra(RingtoneManager.EXTRA_RINGTONE_DEFAULT_URI); 
-
98:	hasSilentItem = intent.getBooleanExtra( 
-
101:	final boolean includeDrm = intent.getBooleanExtra( 
-
104:	int types = intent.getIntExtra(RingtoneManager.EXTRA_RINGTONE_TYPE, -1); 
-
114:	.getParcelableExtra(RingtoneManager.EXTRA_RINGTONE_EXISTING_URI); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: putExtra, setAction
184:	Intent i = new Intent(); 
185:	i.setAction("android.intent.action.UPDATE_PINS"); 
186:	i.putExtra(EXTRA_CONTENT_PATH, contentPath); 
187:	i.putExtra(EXTRA_VERSION_NUMBER, version); 
188:	i.putExtra(EXTRA_REQUIRED_HASH, required); 
189:	i.putExtra(EXTRA_SIGNATURE, sig); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: getAction, getBundleExtra, getParcelableExtra, getStringExtra
47:	String action=intent.getAction(); 
-
61:	failure(intent, "Could not create interpreter: "+intent.getAction()); 
-
65:	success(intent, interpreter.executeScript(intent.getBundleExtra(BUNDLE))); 
-
111:	String broadcast=intent.getStringExtra(BROADCAST_ACTION); 
-
114:	PendingIntent pi=(PendingIntent)intent.getParcelableExtra(PENDING_RESULT); 
-
126:	data.setPackage(intent.getStringExtra(BROADCAST_PACKAGE)); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: putExtra
125:	Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); 
126:	intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); 
127:	intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.ENGLISH); 
-
129:	intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, maxMatches); 
-
131:	intent.putExtra(RecognizerIntent.EXTRA_PROMPT, prompt); 
132:	cordova.startActivityForResult(this, intent, reqCode); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: getExtras, putExtra, removeExtra
77:	String phoneNumber        = intent.getExtras().getString(INTENT_PHONE_NUMBER); 
-
85:	intent.removeExtra(INTENT_PHONE_NUMBER); 
86:	intent.removeExtra("android.phone.extra.ORIGINAL_URI"); 
-
88:	intent.putExtra(INTENT_PHONE_NUMBER, phoneNumber); 
89:	intent.putExtra("android.phone.extra.ORIGINAL_URI", "tel:" + Uri.encode(phoneNumber)); 
Full Snippet Info
10
CodeRank
This code example shows how to use the following methods: getComponent, setComponent
182:	Intent i = new Intent(); 
183:	i.setComponent(new ComponentName(TEST_PACKAGE_NAME, "")); 
-
186:	rpm.addActivityIcon(i, d); 
-
188:	assertThat(rpm.getActivityIcon(i)).isSameAs(d); 
189:	assertThat(rpm.getActivityIcon(i.getComponent())).isSameAs(d); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: addFlags, setClassName
51:	Intent intent = new Intent(); 
52:	intent.setClassName(getTargetContext(), activityClassName); 
53:	intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: createChooser, putExtra, setType
16:	Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); 
17:	emailIntent.setType(mimeType); 
-
23:	emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject); 
-
25:	emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, text); 
-
27:	emailIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file://"+ filename)); 
-
30:	context.startActivity(Intent.createChooser(emailIntent, chooser_title)); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: putExtra
57:	Intent i=new Intent(ACTION_SYNC_PREF); 
-
60:	i.putExtra(EXTRA_SENDER, getPackageName()); 
61:	i.putExtra(EXTRA_KEY, key); 
-
64:	i.putExtra(EXTRA_VALUE, (Boolean)value); 
65:	i.putExtra(EXTRA_TYPE, TYPE_BOOLEAN); 
-
68:	i.putExtra(EXTRA_VALUE, (Float)value); 
-
72:	i.putExtra(EXTRA_VALUE, (Integer)value); 
-
76:	i.putExtra(EXTRA_VALUE, (Long)value); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getAction, getBundleExtra, getParcelableExtra, getStringExtra
47:	String action=intent.getAction(); 
-
61:	failure(intent, "Could not create interpreter: "+intent.getAction()); 
-
65:	success(intent, interpreter.executeScript(intent.getBundleExtra(BUNDLE))); 
-
111:	String broadcast=intent.getStringExtra(BROADCAST_ACTION); 
-
114:	PendingIntent pi=(PendingIntent)intent.getParcelableExtra(PENDING_RESULT); 
-
126:	data.setPackage(intent.getStringExtra(BROADCAST_PACKAGE)); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: hasExtra, putExtra
24:	final Intent modIntent = new Intent(super.getIntent()); 
25:	if (!modIntent.hasExtra(EXTRA_SHOW_FRAGMENT)) { 
26:	modIntent.putExtra(EXTRA_SHOW_FRAGMENT, InputMethodAndSubtypeEnabler.class.getName()); 
27:	modIntent.putExtra(EXTRA_NO_HEADERS, true); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: setComponent
52:	Intent intent = new Intent(); 
53:	intent.setComponent(new ComponentName(this, info.name)); 
54:	startActivity(intent); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: addCategory
207:	Intent intent = new Intent(ACTION_VIEW, Uri.parse(url)); 
208:	intent.addCategory(CATEGORY_BROWSABLE); 
209:	startActivity(intent); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: createChooser, putExtra, setType
31:	final Intent intent = new Intent(Intent.ACTION_SEND); 
32:	intent.setType("text/plain"); 
33:	intent.putExtra(Intent.EXTRA_TEXT, "Shared from the ActionBar widget."); 
34:	return Intent.createChooser(intent, "Share"); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: getAction, getCategories, getComponent, getData, getPackage
491:	if (getAction() != other.getAction()) { 
-
493:	if (!getAction().equals(other.getAction())) { 
-
497:	if (!other.getAction().equals(getAction())) { 
-
502:	if (getData() != other.getData()) { 
-
504:	if (!getData().equals(other.getData())) { 
-
508:	if (!other.getData().equals(getData())) { 
-
513:	if (getType() != other.getType()) { 
-
515:	if (!getType().equals(other.getType())) { 
-
519:	if (!other.getType().equals(getType())) { 
-
524:	if (getPackage() != other.getPackage()) { 
-
526:	if (!getPackage().equals(other.getPackage())) { 
-
530:	if (!other.getPackage().equals(getPackage())) { 
-
535:	if (getComponent() != other.getComponent()) { 
-
537:	if (!getComponent().equals(other.getComponent())) { 
-
541:	if (!other.getComponent().equals(getComponent())) { 
-
546:	if (getCategories() != other.getCategories()) { 
-
548:	if (!getCategories().equals(other.getCategories())) { 
-
552:	if (!other.getCategories().equals(getCategories())) { 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getAction
14:	String actionName = intent.getAction(); 
-
17:	ReceiveIntent(intent); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getParcelableExtra, getStringExtra
53:	String script=intent.getStringExtra(SCRIPT); 
-
83:	String broadcast=intent.getStringExtra(BROADCAST_ACTION); 
-
90:	PendingIntent pi=(PendingIntent)intent.getParcelableExtra(PENDING_RESULT); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: addFlags, putExtra
60:	Intent intent = new Intent(); 
61:	intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); 
62:	intent.putExtra(Browser.BookmarkColumns.TITLE, cursor.getString(TITLE_COLUMN)); 
63:	intent.putExtra(Browser.BookmarkColumns.URL, cursor.getString(URL_COLUMN)); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: getStringExtra
150:	final String registrationId = intent.getStringExtra(EXTRA_REGISTRATION_ID); 
151:	String error = intent.getStringExtra(EXTRA_ERROR); 
152:	String removed = intent.getStringExtra(EXTRA_UNREGISTERED); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getBooleanExtra, getIntExtra, getSerializableExtra, getStringExtra
65:	notificationId = intent.getIntExtra(BUNDLE_KEY_NOTIFICATION_ID, DEFAULT_ROBOSPICE_NOTIFICATION_ID); 
66:	requestClass = (Class<?>) intent.getSerializableExtra(BUNDLE_KEY_REQUEST_CLASS); 
-
70:	requestCacheKey = intent.getStringExtra(BUNDLE_KEY_REQUEST_CACHE_KEY); 
71:	spiceServiceClass = (Class<? extends SpiceService>) intent.getSerializableExtra(BUNDLE_KEY_SERVICE_CLASS); 
72:	foreground = intent.getBooleanExtra(BUNDLE_KEY_FOREGROUND, true); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: getParcelableExtra, putExtra, resolveActivityInfo, toUri
108:	Intent intent = data.getParcelableExtra(Intent.EXTRA_SHORTCUT_INTENT); 
-
110:	intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, data.getStringExtra(Intent.EXTRA_SHORTCUT_NAME)); 
111:	String appUri = intent.toUri(0); 
-
118:	ActivityInfo ai = intent.resolveActivityInfo(pm, PackageManager.GET_ACTIVITIES); 
-
128:	return friendlyName != null || labelOnly ? friendlyName : intent.toUri(0); 
-
138:	return name != null ? name : intent.toUri(0); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getAction, getCategories, getComponent, getData, getPackage
478:	if (getAction() != other.getAction()) { 
-
480:	if (!getAction().equals(other.getAction())) { 
-
484:	if (!other.getAction().equals(getAction())) { 
-
489:	if (getData() != other.getData()) { 
-
491:	if (!getData().equals(other.getData())) { 
-
495:	if (!other.getData().equals(getData())) { 
-
500:	if (getType() != other.getType()) { 
-
502:	if (!getType().equals(other.getType())) { 
-
506:	if (!other.getType().equals(getType())) { 
-
511:	if (getPackage() != other.getPackage()) { 
-
513:	if (!getPackage().equals(other.getPackage())) { 
-
517:	if (!other.getPackage().equals(getPackage())) { 
-
522:	if (getComponent() != other.getComponent()) { 
-
524:	if (!getComponent().equals(other.getComponent())) { 
-
528:	if (!other.getComponent().equals(getComponent())) { 
-
533:	if (getCategories() != other.getCategories()) { 
-
535:	if (!getCategories().equals(other.getCategories())) { 
-
539:	if (!other.getCategories().equals(getCategories())) { 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: addCategory, setComponent, setFlags
63:	Intent i=new Intent(Intent.ACTION_MAIN); 
-
65:	i.addCategory(Intent.CATEGORY_LAUNCHER); 
66:	i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | 
-
68:	i.setComponent(name); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: addFlags, putExtra, setComponent
89:	Intent intent = new Intent(Intent.ACTION_SEARCH); 
90:	intent.setComponent(activity); 
91:	intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 
-
94:	intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); 
95:	intent.putExtra(SearchManager.USER_QUERY, query); 
96:	intent.putExtra(SearchManager.QUERY, query); 
-
98:	intent.putExtra(SearchManager.APP_DATA, appData); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getStringExtra, hasExtra
309:	return resultIntent.hasExtra(STATUS_ERROR_TYPE); 
-
317:	String type = resultIntent.getStringExtra(STATUS_ERROR_TYPE); 
318:	String description = resultIntent.getStringExtra(STATUS_ERROR_DESCRIPTION); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: putExtra, setType
96:	Intent intent = new Intent(Intent.ACTION_SEND); 
97:	intent.putExtra(Intent.EXTRA_EMAIL, new String[] { address }); 
98:	intent.putExtra(Intent.EXTRA_TEXT, body); 
99:	intent.putExtra(Intent.EXTRA_SUBJECT, subject); 
100:	intent.setType(MIME_TYPE_EMAIL); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: getAction, getBooleanExtra, getIntExtra
72:	if (!intent.getAction().equals(Intent.ACTION_BATTERY_CHANGED)) { 
-
86:	if (intent.getBooleanExtra(BatteryManager.EXTRA_PRESENT, false) || 
-
88:	int plugged = intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1); 
-
106:	double current =  (double)intent.getIntExtra(BatteryManager.EXTRA_LEVEL, -1); 
107:	double max = (double)intent.getIntExtra(BatteryManager.EXTRA_SCALE, -1); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: addFlags, putExtra, setAction
81:	Intent intent = new Intent(context, UpgradeDatabases.class); 
82:	intent.setAction(ACTION_UPGRADE_DATABASES); 
83:	intent.putExtra(EXTRA_START_INTENT, startIntent); 
-
86:	intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: addCategory, addFlags, setAction
155:	Intent i = new Intent(Intent.ACTION_MAIN, data); 
-
161:	i.setAction(Intent.ACTION_MAIN); 
162:	i.addCategory(Intent.CATEGORY_LAUNCHER); 
163:	i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); 
164:	i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: createChooser, putExtra, setType
107:	Intent shareIntent = new Intent(Intent.ACTION_SEND); 
108:	shareIntent.putExtra(Intent.EXTRA_TEXT, message); 
109:	shareIntent.putExtra(Intent.EXTRA_SUBJECT, subject); 
110:	shareIntent.setType(MIME_TYPE_TEXT); 
111:	return Intent.createChooser(shareIntent, chooserDialogTitle); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: putExtra, setAction
274:	Intent intent = new Intent(); 
275:	intent.setAction("com.google.zxing.client.android.ENCODE"); 
276:	intent.putExtra("ENCODE_TYPE", "TEXT_TYPE"); 
277:	intent.putExtra("ENCODE_DATA", text); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: putExtra
177:	Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); 
178:	intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, languageModel); 
179:	intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 1); 
180:	intent.putExtra(RecognizerIntent.EXTRA_PROMPT, ContextManager.getContext().getString(prompt)); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: putExtra, setPackage
50:	Intent registrationIntent = new Intent(REQUEST_REGISTRATION_INTENT); 
51:	registrationIntent.setPackage(GSF_PACKAGE); 
52:	registrationIntent.putExtra(EXTRA_APPLICATION_PENDING_INTENT, 
-
54:	registrationIntent.putExtra(EXTRA_SENDER, senderId); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: addCategory, putExtra, setAction
26:	Intent sc_intent = new Intent(); 
27:	sc_intent.setAction(SCRIPT_ACTION); 
28:	sc_intent.addCategory(SCRIPT_CATEGORY); 
29:	sc_intent.putExtra(SCRIPT_NAME, name); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: putExtra, setClass
111:	Intent result = new Intent(); 
112:	result.setClass(this, ListSamples.class); 
113:	result.putExtra("com.jakewharton.android.viewpagerindicator.sample.Path", path); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: putExtra, setData, setFlags
12:	Intent intent = new Intent(context, SubActivity.class); 
13:	intent.setData(Uri.parse("http://mixi.jp")); 
14:	intent.setFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT | Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); 
15:	intent.putExtra(Intent.EXTRA_SUBJECT, title); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: addFlags, putExtra
60:	Intent intent = new Intent(); 
61:	intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); 
62:	intent.putExtra(Browser.BookmarkColumns.TITLE, cursor.getString(TITLE_COLUMN)); 
63:	intent.putExtra(Browser.BookmarkColumns.URL, cursor.getString(URL_COLUMN)); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: putExtra
136:	Intent i = new Intent(mContext, AccountAccessPrompt.class); 
137:	i.putExtra(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE, response); 
138:	i.putExtra("api_key", api_key); 
139:	i.putExtra("api_secret", api_secret); 
140:	i.putExtra("user", user); 
141:	i.putExtra("authToken", authToken); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: putExtra, setPackage
50:	Intent registrationIntent = new Intent(REQUEST_REGISTRATION_INTENT); 
51:	registrationIntent.setPackage(GSF_PACKAGE); 
52:	registrationIntent.putExtra(EXTRA_APPLICATION_PENDING_INTENT, 
-
54:	registrationIntent.putExtra(EXTRA_SENDER, senderId); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: putExtra, setClass
154:	Intent result = new Intent(); 
155:	result.setClass(this, SampleList.class); 
156:	result.putExtra("com.example.android.apis.Path", path); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: addFlags
111:	Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri)); 
112:	intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: putExtra, setType
22:	final Intent intent = new Intent(Intent.ACTION_SEND); 
23:	intent.setType("message/rfc822"); 
-
26:	intent.putExtra(Intent.EXTRA_EMAIL, new String[] { to }); 
-
29:	intent.putExtra(Intent.EXTRA_SUBJECT, subject); 
-
32:	intent.putExtra(Intent.EXTRA_TEXT, body); 
-
38:	intent.setType("text/plain"); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: putExtra, setClass
154:	Intent result = new Intent(); 
155:	result.setClass(this, SampleList.class); 
156:	result.putExtra("com.example.android.apis.Path", path); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: addCategory, putExtra, setComponent
85:	Intent intent = new Intent(Intent.ACTION_WEB_SEARCH); 
86:	intent.setComponent(mSearchable.getSearchActivity()); 
87:	intent.addCategory(Intent.CATEGORY_DEFAULT); 
88:	intent.putExtra(SearchManager.QUERY, query); 
-
93:	intent.putExtra(SearchManager.EXTRA_DATA_KEY, extraData); 
-
95:	intent.putExtra(Browser.EXTRA_APPLICATION_ID, context.getPackageName()); 
-
101:	intent.putExtra(SearchManager.EXTRA_WEB_SEARCH_PENDINGINTENT, pending); 
Full Snippet Info
8
CodeRank
Related Android Intent Questions & Answers:
Other Android Intent Examples
15:	
16:	  public void onClick(View view) {
17:	    Intent intent = new Intent(WallpaperManager.ACTION_CHANGE_LIVE_WALLPAPER);
18:	    intent.putExtra(WallpaperManager.EXTRA_LIVE_WALLPAPER_COMPONENT,
19:	        new ComponentName(this, MyWallpaperService.class));
-
15:	
16:	  public void onClick(View view) {
17:	    Intent intent = new Intent(WallpaperManager.ACTION_CHANGE_LIVE_WALLPAPER);
18:	    intent.putExtra(WallpaperManager.EXTRA_LIVE_WALLPAPER_COMPONENT,
19:	        new ComponentName(this, MyWallpaperService.class));

Read More

26:	
27:	  public void pickImage(View View) {
28:	    Intent intent = new Intent();
29:	    intent.setType("image/*");
30:	    intent.setAction(Intent.ACTION_GET_CONTENT);
-
26:	
27:	  public void pickImage(View View) {
28:	    Intent intent = new Intent();
29:	    intent.setType("image/*");
30:	    intent.setAction(Intent.ACTION_GET_CONTENT);
-
34:	
35:	  @Override
36:	  protected void onActivityResult(int requestCode, int resultCode, Intent data) {
37:	    InputStream stream = null;
38:	    if (requestCode == REQUEST_CODE && resultCode == Activity.RESULT_OK)

Read More

1:	IntentFilter filter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED);
2:	
3:	/ Intent is sticky so using null as receiver works fine
4:	// return value contains the status
5:	Intent batteryStatus = this.registerReceiver(null, filter);
-
3:	/ Intent is sticky so using null as receiver works fine
4:	// return value contains the status
5:	Intent batteryStatus = this.registerReceiver(null, filter);
6:	
7:	// Are we charging / charged?

Read More

2:		 */
3:		private void recordVideo() {
4:			Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
5:	
6:			fileUri = getOutputMediaFileUri(MEDIA_TYPE_VIDEO);
-
2:		 */
3:		private void recordVideo() {
4:			Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
5:	
6:			fileUri = getOutputMediaFileUri(MEDIA_TYPE_VIDEO);

Read More

2:		 */
3:		private void captureImage() {
4:			Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
5:	
6:			fileUri = getOutputMediaFileUri(MEDIA_TYPE_IMAGE);
-
2:		 */
3:		private void captureImage() {
4:			Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
5:	
6:			fileUri = getOutputMediaFileUri(MEDIA_TYPE_IMAGE);

Read More

2:		 * */
3:		@Override
4:		protected void onActivityResult(int requestCode, int resultCode, Intent data) {
5:			// if the result is capturing Image
6:			if (requestCode == CAMERA_CAPTURE_IMAGE_REQUEST_CODE) {

Read More

2:	    ...
3:	    // Triggers password change screen in Settings.
4:	    Intent intent =
5:	        new Intent(DevicePolicyManager.ACTION_SET_NEW_PASSWORD);
6:	    startActivity(intent);
-
3:	    // Triggers password change screen in Settings.
4:	    Intent intent =
5:	        new Intent(DevicePolicyManager.ACTION_SET_NEW_PASSWORD);
6:	    startActivity(intent);
7:	}

Read More

1:	if (!mPolicy.isAdminActive()) {
2:	
3:	    Intent activateDeviceAdminIntent =
4:	        new Intent(DevicePolicyManager.ACTION_ADD_DEVICE_ADMIN);
5:	
-
2:	
3:	    Intent activateDeviceAdminIntent =
4:	        new Intent(DevicePolicyManager.ACTION_ADD_DEVICE_ADMIN);
5:	
6:	    activateDeviceAdminIntent.putExtra(

Read More

5:	    // Create an Intent that describes the requirements to fulfill, to be included
6:	    // in our menu. The offering app must include a category value of Intent.CATEGORY_ALTERNATIVE.
7:	    Intent intent = new Intent(null, dataUri);
8:	    intent.addCategory(Intent.CATEGORY_ALTERNATIVE);
9:	
-
5:	    // Create an Intent that describes the requirements to fulfill, to be included
6:	    // in our menu. The offering app must include a category value of Intent.CATEGORY_ALTERNATIVE.
7:	    Intent intent = new Intent(null, dataUri);
8:	    intent.addCategory(Intent.CATEGORY_ALTERNATIVE);
9:

Read More

See Code Examples for Android Intent Methods: