开发者

Android 1.6: onActivityResult is not called

开发者 https://www.devze.com 2023-01-06 08:56 出处:网络
I have a problem with the method \"onActivityResult\". I create a new Activity from my main activity: Intent intent = new Intent(this, NewActivity.class);

I have a problem with the method "onActivityResult". I create a new Activity from my main activity:

Intent intent = new Intent(this, NewActivity.class);
startActivityForResult(intent, 0);

The new Activity is ended like this:

Intent resultIntent = new Intent();
resultIntent.putExt开发者_Python百科ra("vid", hmvenues.get(venues[currentPosition]));
resultIntent.putExtra("name", venues[currentPosition]);
setResult(RESULT_OK, resultIntent);
finish();

But the Method onActivityResult seem to be not called

@Override 
public void onActivityResult(int requestCode, int resultCode, Intent data) {     
   Log.d(this.getClass().getName(),"onActivityResult");
   ...
}

Does anyone have an idea, what I did wrong? Thanks!! Seb


Oh, I found the error: I had another Activity open, which was on the Activity stack between those Activities and caused the problem.

0

精彩评论

暂无评论...
验证码 换一张
取 消