Questions tagged «android-tabhost»

5
如何从TabHost活动返回结果(startActivityForResult)?
我的示例中有3个班级:A类,主要活动。A类调用startActivityForResult: Intent intent = new Intent(this, ClassB.class); startActivityForResult(intent, "STRING"); B类,此类是TabActivity: Intent intent = new Intent(this, ClassC.class); tabHost.addTab... C类,该类为常规活动: Intent intent = this.getIntent(); intent.putExtra("SOMETHING", "EXTRAS"); this.setResult(RESULT_OK, intent); finish(); 在Class A中调用了onActivityResult,但是使用了resultCode RESULT_CANCELED而不是,RESULT_OK返回的intent为null。如何从TabHost内的Activity返回某些内容? 我意识到问题在于我的C类实际上是在B类内部运行的,而B类才是回到RESULT_CANCELEDA类的原因。我只是不知道解决方法。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.