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

voidpickNcapture(Activity activity, Uri outputFileUri)
pick Ncapture
Intent pickIntent = new Intent();
pickIntent.setType("image/*");
pickIntent.setAction(Intent.ACTION_GET_CONTENT);
Intent takePhotoIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
takePhotoIntent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
String pickTitle = "Select or take a new Picture";
Intent chooserIntent = Intent.createChooser(pickIntent, pickTitle);
chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS,
...
voidorganizeAndStart(Activity activity, Class classes, Map paramMap)
organize And Start
intent = new Intent(activity, classes);
if (null != paramMap) {
    Set<String> set = paramMap.keySet();
    for (Iterator<String> iterator = set.iterator(); iterator
            .hasNext();) {
        String key = iterator.next();
        intent.putExtra(key, paramMap.get(key));
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
activity.startActivity(intent);
booleanonKeyBackGoHome(Activity activity, int keyCode, KeyEvent event)
on Key Back Go Home
if (!(keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0)) {
    return false; 
activity.startActivity(new Intent().setAction(Intent.ACTION_MAIN)
        .addCategory(Intent.CATEGORY_HOME));
return true;
voidmakeCall(Activity activity, String telNumber)
make Call
activity.startActivity(new Intent(Intent.ACTION_CALL, Uri
        .parse("tel:" + telNumber)));
voidPhotoIntent(Activity activity)
Photo Intent
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
Uri fileUri = getOutputMediaFileUri(MEDIA_TYPE_IMAGE);
intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri);
activity.startActivityForResult(intent,
        CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE);
voidVideoIntent(Activity activity)
Video Intent
Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
Uri fileUri = getOutputMediaFileUri(MEDIA_TYPE_VIDEO);
intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri);
intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 1);
activity.startActivityForResult(intent,
        CAPTURE_VIDEO_ACTIVITY_REQUEST_CODE);
voidcall(String aPhoneNumber, Activity aActivity)
Calls a phone number
Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:" + aPhoneNumber));
aActivity.startActivity(callIntent);
voidintentSysDefault(Activity activity, Class classes, Map paramMap)
intent Sys Default
organizeAndStart(activity, classes, paramMap);
voidaudioBecomingNoisy(Context c)
Send a AudioManager.ACTION_AUDIO_BECOMING_NOISY event.
Intent i = new Intent();
i.setAction(android.media.AudioManager.ACTION_AUDIO_BECOMING_NOISY);
c.sendBroadcast(i);
voidlaunchUrlInBrowser(Context context, String url)
launch Url In Browser
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
context.startActivity(i);