saying that... I have been testing on a network other than Tmobile...
If anyone reading this in the US on Tmobile tries this, please post
the results. You will need to change the USSD code to one that is
valid for Tmobile, one that returns the handset mobile number would be
a good choice.

Also enable calling in the manifest and create a TextView called
sometext.

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        String encodedHash = Uri.encode("#");

        view = (TextView) findViewById(R.id.sometext);
        call("*121" + encodedHash);
    }


    protected void call(String phoneNumber) {
        startActivityForResult(new Intent("android.intent.action.CALL",
                       Uri.parse("tel:" + phoneNumber)), 1);
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode,
Intent data) {
        view.setText("USSD: " + requestCode + " " + resultCode + " " +
data);
    }


On Mar 10, 5:44 pm, Ray <[email protected]> wrote:
> I expected to see the response by using startActivityForResult and
> onActivityResult(int requestCode, int resultCode, Intent data)
>
> But that didn't work for me and I've run out of ideas.
>
> Ray
>
> On Mar 3, 6:29 am, "[email protected]" <[email protected]> wrote:
>
> > Does the Android API provide a way to catch the USSD response after
> > the dial?
>
> > thanks
>
> > On Jan 29, 5:41 am, sabdart <[email protected]> wrote:
>
> > > Not a bug and it is in the documentation (http://code.google.com/
> > > android/reference/android/net/Uri.html)
> > > I should have been escaping the # symbol with %23
>
> > > String encodedHash = Uri.encode("#");
>
> > > startActivity(new Intent("android.intent.action.DIAL",
> > >      Uri.parse("tel:**004*+668190099" + encodedHash)));
>
> > > Note to self: RTFM
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to