1
String encodedHash = Uri.encode("#");
String ussd = "*" + encodedHash + "105" + encodedHash;
startActivityForResult(new Intent("android.intent.action.CALL", Uri.parse("tel:" + ussd)), 1); 

This calls the USSD and the result is displayed in an alert menu generated by the OS dialer. There's no way that I can see to intercept the USSD reply, prevent the dialer displaying it, and then use the result as a String. Essentially, all I really want to do is (pseudo code)

String ussdReply = call("*#105#");

I've tried creating an onActivityResult but it never receives anything from the startActivityForResult. So, does anyone know how I can use the reply within an application???

HalR
  • 11,411
  • 5
  • 48
  • 80
  • You can't. Android doesn't really support USSD- an individual dialer app might, but the OS doesn't provide APIs for it. ANd I don't blame them- it's a horrible way to do things, a hack from the days before smartphones and cellular data streams. They're trying to give it the death is deserves. – Gabe Sechan May 09 '13 at 19:02
  • This might help: http://stackoverflow.com/questions/12594250/ussd-service-not-working – JiTHiN May 10 '13 at 03:37

0 Answers0