How to send Activation code like *777# to dialer using an Intent? Code Answer

Hello Developer, Hope you guys are doing great. Today at Tutorial Guruji Official website, we are sharing the answer of How to send Activation code like *777# to dialer using an Intent? without wasting too much if your time.

The question is published on by Tutorial Guruji team.

I want to send code *777# to dialer in android using intent but i have a problem only *777 key code will be displayed on dialer not # how to resolve this issue i’m new in android developer so please help me out this problem.

    String dialler_Code = "*777#";
    Toast.makeText(this, "clicked", Toast.LENGTH_LONG)
            .show();

    // Use format with "tel:" and phoneNumber created is stored in u.

    Uri u = Uri.parse("tel:" + dialler_Code);

    // Create the intent and set the data for the intent as the phone number.

    Intent i = new Intent(Intent.ACTION_DIAL, u);
      try {
        // Launch the Phone app's dialer with a phone number to dial a call.
        startActivity(i);
    } catch (SecurityException s) {

        // show() method display the toast with exception message.
        Toast.makeText(this, s.getMessage() , Toast.LENGTH_LONG)
                .show();
    }

Answer

Try with String dialler_Code = Uri.encode("*777#");

We are here to answer your question about How to send Activation code like *777# to dialer using an Intent? - If you find the proper solution, please don't forgot to share this with your team members.

Related Posts

Tutorial Guruji