get default dial pad, By avoiding chooser

123 Views Asked by At

I know to make direct call without chooser programatically like below

   String numberToBeCalled = "1234567890";
   Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse(numberToBeCalled));
   intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
   if (android.os.Build.VERSION.SDK_INT >=android.os.Build.VERSION_CODES.LOLLIPOP) {
   intent.setPackage("com.android.server.telecom");
   } else {
   //for lower versions like 4.4 package name will com.android.phone
    intent.setPackage("com.android.phone");
    }
   startActivity(intent);

But now my current issue is, I want to get android default dial-pad.below code will open dial-pad, but if any other apps available in device like true-caller, then this will go for chooser, which i don't want.

 Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + numberToBeCalled));
 ...........................
 intent.setPackage("need help");
...........................
 startActivity(intent);

Here missing is dial-Pad package,Please help me, Thanks in advance, I did search no possible help i found,So posting here

0

There are 0 best solutions below