活动从这里开始:
startActivityForResult(new Intent(this, ChatActivity.class), 2);
ChatActivity 启动,然后调用此方法并打印 2:
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
System.out.println(requestCode);
}
在不更改 ChatActivity 对象的情况下,如何使用 Android API 调用获取对 ChatActivity 的引用?