• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps "onActivityResult" doesn't work

I'm developping an app:
there is main TabActivity, which has two tabs with two different Activities.
In one of them I have

Code:
Intent i = new Intent(getApplicationContext(), PrepareRequestTokenActivity.class);
startActivityForResult(i, OAUTH_REQUEST);

PrepareRequestTokenActivity executes OAuth authentification using a browser and when it's done, has these lines

Code:
setResult(RESULT_OK, null);
finish();

And, finally, I have onActivityResult method in Activity, which I was starting ActivityForResult from

Code:
@Override
	protected void onActivityResult(int requestCode, int resultCode, Intent data) {...}

As I see logs, result is set correctly, but there is no call of onActivityResult :(

What can be the problem?
Or should I provide the whole project to let you help me?
 
update:
Through the logs, onActivityResult is called right when activity that i'm starting BeGIN to work oO
not waiting setResult(..) and finish() methods.
Why is it that way?
 
Well, the problem is in
Code:
android:launchMode="singleTask"
But if I remove this, I can't use onNewIntent method, can I?

So what would be the solution, if I want to know, when does the activity end, but in this activity I want to catch an intent from browser?
 
Back
Top Bottom