Android Intent - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android Intent class.

This code example shows how to use the following methods: putExtra
        } 
        catch (Exception e) {
            Log.e(LOG_TAG, String.format("startSpeechRecognitionActivity exception: %s", e.toString()));
        } 
 
        Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
        intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
        intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.ENGLISH);
        if (maxMatches > 0)
            intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, maxMatches);
        if (!prompt.equals(""))
            intent.putExtra(RecognizerIntent.EXTRA_PROMPT, prompt);
        cordova.startActivityForResult(this, intent, reqCode);
    } 
 
    /** 
     * Handle the results from the recognition activity. 
     */ 
    @Override 
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
Full Snippet Info
10
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: addFlags, putExtra, setClass, setClipData
    @SuppressLint("NewApi") 
    public static Intent createChooser(Intent target, CharSequence title) {
        if (VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN) {
            return Intent.createChooser(target, title);
        } 
        Intent intent = new Intent();
        intent.setClass(Application.getLastInstance(), ChooserActivity.class);
        intent.putExtra(Intent.EXTRA_INTENT, target);
        if (title != null) {
            intent.putExtra(Intent.EXTRA_TITLE, title);
        } 
        int permFlags = target.getFlags()
                & (Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
        if (permFlags != 0 && VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN) {
            ClipData targetClipData = target.getClipData();
            if (targetClipData == null && target.getData() != null) {
                ClipData.Item item = new ClipData.Item(target.getData());
                String[] mimeTypes;
                if (target.getType() != null) {
                    mimeTypes = new String[]{

9
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: putExtra
    protected Object onGetDefaultValue(TypedArray a, int index) {
        return a.getString(index);
    } 
 
    protected void onPrepareRingtonePickerIntent(Intent ringtonePickerIntent) {
        ringtonePickerIntent.putExtra(
                RingtoneManager.EXTRA_RINGTONE_EXISTING_URI,
                onRestoreRingtone()); 
        ringtonePickerIntent.putExtra(
                RingtoneManager.EXTRA_RINGTONE_SHOW_DEFAULT, mShowDefault);
        if (mShowDefault) {
            ringtonePickerIntent.putExtra(
                    RingtoneManager.EXTRA_RINGTONE_DEFAULT_URI,
                    RingtoneManager.getDefaultUri(getRingtoneType()));
        } 
        ringtonePickerIntent.putExtra(
                RingtoneManager.EXTRA_RINGTONE_SHOW_SILENT, mShowSilent);
        ringtonePickerIntent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE,
                mRingtoneType);
        ringtonePickerIntent.putExtra(RingtoneManager.EXTRA_RINGTONE_TITLE,

9
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getBooleanExtra, getIntExtra, getParcelableExtra
    public _RingtonePickerDialog create() { 
        if (dialog != null) {
            return this;
        } 
        handler = new Handler();
        hasDefaultItem = intent.getBooleanExtra(
                RingtoneManager.EXTRA_RINGTONE_SHOW_DEFAULT, true);
        uriForDefaultItem = intent
                .getParcelableExtra(RingtoneManager.EXTRA_RINGTONE_DEFAULT_URI);
        if (uriForDefaultItem == null) {
            uriForDefaultItem = Settings.System.DEFAULT_RINGTONE_URI;
        } 
        hasSilentItem = intent.getBooleanExtra(
                RingtoneManager.EXTRA_RINGTONE_SHOW_SILENT, true);
        ringtoneManager = new RingtoneManager(context);
        final boolean includeDrm = intent.getBooleanExtra(
                RingtoneManager.EXTRA_RINGTONE_INCLUDE_DRM, true);
        ringtoneManager.setIncludeDrm(includeDrm);
        int types = intent.getIntExtra(RingtoneManager.EXTRA_RINGTONE_TYPE, -1);
        if (types != -1) {

9
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: putExtra, setAction
        signer.update(requiredPrevious.trim().getBytes());
        return signer.verify(Base64.decode(signature.getBytes(), Base64.DEFAULT));
    } 
 
    private void sendIntent(String contentPath, String version, String required, String sig) {
        Intent i = new Intent();
        i.setAction("android.intent.action.UPDATE_PINS");
        i.putExtra(EXTRA_CONTENT_PATH, contentPath);
        i.putExtra(EXTRA_VERSION_NUMBER, version);
        i.putExtra(EXTRA_REQUIRED_HASH, required);
        i.putExtra(EXTRA_SIGNATURE, sig);
        mContext.sendBroadcast(i);
    } 
 
    private String runTest(String cert, String content, String version, String required, String sig)
                           throws Exception { 
        Log.e(TAG, "started test");
        overrideCert(cert);
        String contentPath = makeTemporaryContentFile(content);
        sendIntent(contentPath, version, required, sig);
Full Snippet Info
9
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

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: