Skip to content Skip to sidebar Skip to footer

Android Phone Application Intent

I want to launch the phone application on the phone as an intent I am using this code startActivity(getPackageManager().getLaunchIntentForPackage('com.android.phone')); but the fu

Solution 1:

I managed to answer my question thanks for your answers the didn't exactly met the thing I wanted but on base of tham I figured it out

I just had to call

Intentintent=newIntent(Intent.ACTION_DIAL);

startActivity(intent);

to open only the phone application

Solution 2:

You need permissions for certain ones ...better off doing

Intentintent=newIntent(Intent.ACTION_MAIN, null);
 intent.addCategory(Intent.CATEGORY_LAUNCHER);
     List<ResolveInfo> packs = mContext.getPackageManager().queryIntentActivities(intent,     PackageManager.PERMISSION_GRANTED);

and then you got the list of things you have permission for and then sort through this to launch.

Solution 3:

I have used the below code to dial a phone number with an intent, it might work for you.

Stringuri="tel:" + phoneNumber.trim() ;
Intentintent=newIntent(Intent.ACTION_DIAL);
intent.setData(Uri.parse(uri));
startActivity(intent);

Solution 4:

I solved this problem previously, so here it is:

Intenti=newIntent();
PackageManagermanager= getPackageManager();
i = manager.getLaunchIntentForPackage("com.android.htcdialer");
i.addCategory(Intent.CATEGORY_LAUNCHER);
startActivity(i);

Post a Comment for "Android Phone Application Intent"