好奇,如果我可以调用某些第三方活动,然后在onActivityResult中读取我的原始意图数据。
答案 0 :(得分:3)
我对我没有任何意义,真的......无论如何,因为onActivityResult
将始终是启动第三方活动的同一Activity
的一部分,您只需保存该数据在你的活动的某个地方。例如:
private Intent intentForThat3rdPartyActivity = null; // long name, huh?
public void hereYouLaunchThings(){
if( intentForThat3rdPartyActivity == null ){
intentForThat3rdPartyActivity = new Intent(YourActitity.this, The3rdPartyActivity.class);
intentForThat3rdPartyActivity.putExtra("weird", "data");
}
startActivityForResult(intentForThat3rdPartyActivity, 9999);
}
@Override
protected void onActivityResult(int requestCode, int resultCode,
Intent data) {
// this should have the same data you passed
String foo = intentForThat3rdPartyActivity.getStringExtra("weird");
}