Domanda

I'm trying to create an android app to simply dial a ussd code. I've searched all over and tried everything I could but no luck. Is there anyone that can help me? and btw I'm very new to this and I have no idea where to start. Any help would be appreciated.

È stato utile?

Soluzione 2

you can just dial using call intent. use the ussd number as the input there. For example

Intent callIntent = new Intent(Intent.ACTION_CALL, Uri.parse("*123#")); 
        startActivity(callIntent);

Altri suggerimenti

Sometimes when using (*123#) the hash sign doesn't show up..got this code from a fellow user here and it works perfectly with the code above:

String encodedHash = Uri.encode("#");
            String ussd = "*" + "123" + encodedHash;
            startActivityForResult(new Intent("android.intent.action.CALL",
            Uri.parse("tel:" + ussd)), 1);
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top