List of utility methods to do Intent Create
void | sendBroadcast(Context c, Intent i, boolean local) send Broadcast if (local) LocalBroadcastManager.getInstance(c).sendBroadcast(i); else c.sendBroadcast(i); |
void | sendUpdateCallerInfoCacheIntent(Context context) Sends an Intent, notifying CallerInfo cache should be updated. context.sendBroadcast(new Intent(UPDATE_CALLER_INFO_CACHE));
|
Intent | getGalleryIntent() get Gallery Intent Intent intent = new Intent(); intent.setAction(Intent.ACTION_PICK); intent.setDataAndType(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, "image/*"); return intent; |
Intent | getCutPicIntent(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); ... |
Intent | getSysAppDetailIntent(Context context) get Sys App Detail Intent return new Intent( Intent.ACTION_VIEW, Uri.parse("market://details?id=" + context.getPackageName())); |
Intent | getSysAppSearchIntent(String key) get Sys App Search Intent return new Intent(Intent.ACTION_VIEW, Uri.parse("market://search?q=" + key)); |
boolean | intentAvailable(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;
|
Intent | intentFromByteArray(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;
|
Intent | newXdiPlayIntent() new Xdi Play Intent return new Intent("com.google.android.music.xdi.intent.PLAY"); |
void | shareImages(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); |