Hi there!
I've just started coding for Android. My network provider has a
service via USSD to let you know what's your credit, your various
bonuses and so on, and so I decided to create an activity to get that
data for the user instead of "calling" it.

So far I've found only a little on this, can't find even any
documentation on it. This is the code I've got so far:

package com.elegos.windinforma;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.widget.TextView;

public class WindInforma extends Activity {
    private TextView view;
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

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

        this.view = (TextView) findViewById(R.id.main);
        call("*123" + encodedHash); // just an example: credit
    }

    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);
    }
}

It ends unexpectedly. Do you know anything it may help me?

I'm developing in Android 1.5
Thanks

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"android-framework" 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-framework?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to