Are you using android:launchMode="singleTask" or "singleInstance"?
On Jun 12, 7:28 am, Borislav Bonev <[EMAIL PROTECTED]> wrote:
> Hi all,
> I'm trying to retrieve a result from sub activity but my method
> onResultActivity() is called before I set the result or at least the log say
> that. This is the snipped for starting the sub activity:protected static
> final int REQUEST_TEXT = 111;
> ......
> @Override
> public void onClick(View v) {
> super.onClick(v);
> Intent intent = new Intent(EventsActivity.this,
> TextActivity.class);
> startSubActivity(intent, REQUEST_TEXT);
> }and this is the snipped for the result:private OnClickListener
> mConfirm = new View.OnClickListener() {
> @Override
> public void onClick(View v) {
> EditText text = (EditText) findViewById(R.id.text_field);
> String data = new StringBuffer(text.getText()).toString();
> Log.d("TEXT_ACTIVITY", "Sending back data=" + data);
> setResult(RESULT_OK, data);
> finish();
> }
> };The problem is that my onResultActivity() method in my parent activity
> is called right after the sub activity is shown with result code ==
> RESULT_CANCEL and no data. According Android's documentation the method is
> called after calling finish() method of the child activity.
> Am I right? or something is wrong here. Please help.
> This is article for
> reference http://code.google.com/android/kb/commontasks.html#opennewscreen.
> And one more thing there is an error in the example for onResultActivity()
> method.
--~--~---------~--~----~------------~-------~--~----~
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]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---