Showing posts with label implicit Intents. Show all posts
Showing posts with label implicit Intents. Show all posts

Monday, February 18, 2013

Most Frequently used implicit Intents


1. opening a browser :

Intent intent=new Intent(Intent.ACTION_VIEW,Uri.pars("https://www.google.com"));
satrtActivity(intent);


2. Call when button click :

Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:"+txtphn.getText().toString().trim()));
callIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(callIntent);


3. External Camera :

Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, Constants.mImageCaptureUri);
startActivityForResult(intent, PICK_FROM_CAMERA);


4. Pick from Gallary :

Intent i = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
startActivityForResult(i, RESULT_LOAD_IMAGE);