Android Utililty Methods Intent Create

List of utility methods to do Intent Create

Description

The list of methods to do Intent Create are organized into topic(s).

Method

voidsendBroadcast(Context c, Intent i, boolean local)
send Broadcast
if (local)
    LocalBroadcastManager.getInstance(c).sendBroadcast(i);
else
    c.sendBroadcast(i);
voidsendUpdateCallerInfoCacheIntent(Context context)
Sends an Intent, notifying CallerInfo cache should be updated.
context.sendBroadcast(new Intent(UPDATE_CALLER_INFO_CACHE));
IntentgetGalleryIntent()
get Gallery Intent
Intent intent = new Intent();
intent.setAction(Intent.ACTION_PICK);
intent.setDataAndType(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
        "image/*");
return intent;
IntentgetCutPicIntent(Uri uri, int outputX, int outputY)
get Cut Pic Intent
Intent intent = new Intent("com.android.camera.action.CROP");
intent.setDataAndType(uri, "image/*");
intent.putExtra("crop", "true");
intent.putExtra("aspectX", 2);
intent.putExtra("aspectY", 1);
intent.putExtra("outputX", outputX);
intent.putExtra("outputY", outputY);
intent.putExtra("scale", true);
...
IntentgetSysAppDetailIntent(Context context)
get Sys App Detail Intent
return new Intent(
        Intent.ACTION_VIEW,
        Uri.parse("market://details?id=" + context.getPackageName()));
IntentgetSysAppSearchIntent(String key)
get Sys App Search Intent
return new Intent(Intent.ACTION_VIEW,
        Uri.parse("market://search?q=" + key));
booleanintentAvailable(Context context, Intent intent)
checks if a given intent can be called on the system
return context
        .getPackageManager()
        .queryIntentActivities(intent,
                PackageManager.MATCH_DEFAULT_ONLY).size() > 0;
IntentintentFromByteArray(byte[] byteArray)
intent From Byte Array
Parcel obtain = Parcel.obtain();
obtain.unmarshall(byteArray, 0, byteArray.length);
obtain.setDataPosition(0);
Intent createFromParcel = Intent.CREATOR.createFromParcel(obtain);
obtain.recycle();
return createFromParcel;
IntentnewXdiPlayIntent()
new Xdi Play Intent
return new Intent("com.google.android.music.xdi.intent.PLAY");
voidshareImages(Activity activity, String imagePath)
share Images
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("image/png");
intent.putExtra(Intent.EXTRA_STREAM, Uri.parse(imagePath));
activity.startActivity(intent);