我有2个活动 - A和B.我有一个活动A的列表,如果点击它,它会进入活动B.在活动B上,我有用下面的代码共享电子邮件按钮:发送电子邮件的问题...返回到上一个活动
shareEmail = (Button) findViewById(R.id.emailButton);
shareEmail.setOnClickListener(new View.OnClickListener()
{
public void onClick(View v)
{
System.out.println("!!! email !!!");
Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.setType("text/html");
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "sharing something interesting");
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "sharing something interesting !!");
//hideKeyboard();
activityB.this.startActivity(emailIntent);
}
});
现在,当我发送一封电子邮件,该电子邮件窗口关闭,活动B也关闭。我不确定为什么会这样。任何提示?谢谢。
logcat的输出:
09-20 04:14:05.969: INFO/ActivityManager(60): Starting activity: Intent { act=android.intent.action.CHOOSER cmp=android/com.android.internal.app.ChooserActivity (has extras) }
09-20 04:14:06.279: INFO/ActivityManager(60): Starting activity: Intent { act=android.intent.action.SEND typ=application/octet-stream flg=0x3000000 cmp=com.android.email/.activity.MessageCompose (has extras) }
09-20 04:14:06.699: DEBUG/dalvikvm(2790): GC_FOR_MALLOC freed 7815 objects/586592 bytes in 128ms
09-20 04:14:12.099: INFO/ActivityManager(60): Displayed activity com.android.email/.activity.MessageCompose: 5794 ms (total 6097 ms)
09-20 04:14:18.158: DEBUG/dalvikvm(2768): GC_EXPLICIT freed 4016 objects/308824 bytes in 217ms
09-20 04:14:19.098: WARN/InputManagerService(60): Starting input on non-focused client [email protected] (uid=10025 pid=2790)
09-20 04:14:19.128: WARN/IInputConnectionWrapper(2790): showStatusIcon on inactive InputConnection
09-20 04:14:19.709: DEBUG/webviewglue(2790): nativeDestroy view: 0x374c08
09-20 04:14:21.339: DEBUG/dalvikvm(60): GC_EXPLICIT freed 10068 objects/491696 bytes in 207ms
09-20 04:14:24.739: DEBUG/dalvikvm(2696): GC_EXPLICIT freed 1576 objects/82792 bytes in 123ms
09-20 04:14:29.849: DEBUG/dalvikvm(2790): GC_EXPLICIT freed 5335 objects/279624 bytes in 224ms
2011-09-20
ahsan
+0
请添加您的logcat错误 –
+0
@CapDroid:没有错误,但输出附带的问题! –
+1
Ohhh你在电子邮件应用程序注册并尝试使用startActivityForResult –