2

我想知道我是否像这样通过其他课程进行活动:

public class GateActivity extends MapActivity {

private Presenter assistant = null;

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    assistant = new Presenter(this);
// ...
}

还有这个类:

public class Presenter {
private android.app.Activity act;

public Presenter(android.app.Activity a){
    this.act = a;
    // ...
}

如果可以在“Presenter”类中创建这样的意图:

intent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI);
intent.setType("image/*");
act.startActivityForResult(intent, 1);

并创建/处理其“Override onActivityResult(...)”方法:

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data){
    switch (requestCode){
    case 1: // ...
}

提前致谢!;)

4

1 回答 1

0

是的,这应该工作。

当被调用的活动完成后,GateActivity.onActivityResult()将被调用。

于 2012-11-09T13:29:14.837 回答