Hi Friends,
I start calculator from my activity and override onActivityResult method,
however I cannot handle result from calculator.
Is it possible?
Here is my code.

public static final String CALCULATOR_PACKAGE =
         "com.android.calculator2";
        public static final String CALCULATOR_CLASS =
         "com.android.calculator2.Calculator";

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        Intent i = new Intent();
        i.setAction(Intent.ACTION_MAIN);
        i.addCategory(Intent.CATEGORY_LAUNCHER);

        i.setFlags(
         Intent.FLAG_ACTIVITY_NEW_TASK |
         Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
        i.setComponent(new ComponentName(
         CALCULATOR_PACKAGE,
         CALCULATOR_CLASS));
        startActivityForResult(i, 1001);
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent
data) {

        // TODO Auto-generated method stub
        super.onActivityResult(requestCode, resultCode, data);
        Log.d("CheckStartActivity","onActivityResult and resultCode =
"+resultCode);
        if(requestCode == 1001) {
            Log.i("data:",data.getExtras().get("data").toString());
        }

    }

-- 
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