Android Question Make app to default dialer

S.M.R

Member
Hello
i need to make my app to default dialer

after search i found solution in below link :
https://stackoverflow.com/questions/54190881/android-how-to-make-a-default-dialer-app

and solution is :
Java:
   private void setDefaultDialer()


 {
    AlertDialog.Builder builder;
    builder = new AlertDialog.Builder(this);
    builder.setMessage("Do you want to make Cricket your default Dialer?(it will not cover or replace your dialer)")
            .setCancelable(false)
            .setPositiveButton("Yes", new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int id) {
                    defaultDialerPackage = "cricket";
                    Intent intent = new Intent(TelecomManager.ACTION_CHANGE_DEFAULT_DIALER);
                    startActivityForResult(intent.putExtra(TelecomManager.EXTRA_CHANGE_DEFAULT_DIALER_PACKAGE_NAME,getPackageName()),REQUEST_CODE_SET_DEFAULT_DIALER);
                }
            })
            .setNegativeButton("No", new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int id) {
                    dialog.cancel();
                    Toast.makeText(getApplicationContext(),"Cancelled - No action was taken",
                            Toast.LENGTH_SHORT).show();
                }
            });

AlertDialog alert = builder.create();
alert.setTitle("Cricket need default dialer permission!!");
alert.show();


How i can use solution in B4A ?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

S.M.R

Member


Thanks for your answer.

So how I can check if my app isn't default dialer show a dialog system for choose like bellow picture on android 10+



 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…