在学习Android中的Activity LifeCycle时,我对这两种方法感到困惑。我尝试分别实现它们并且工作正常。那么,这两对双胞胎有什么区别呢?
我不想发送 emails
给其他用户。我只希望打开launching activity
的Email
。我已经通过不同的方式尝试过,但每次发送email(compose)
都是打开的。但我只想打开Email
应用程序(已发送、发件箱、垃圾邮件、垃圾邮件等)。
我的代码在下面
Intent intent = new Intent(Intent.ACTION_SENDTO)
.setData(Uri.parse("mailto:"));
//check if the target app is available or not
if (intent.resolveActivity(getPackageManager()) != null) {
startActivity(intent);
}
Run Code Online (Sandbox Code Playgroud)
同样,此代码打开send email to
(撰写)选项。但我想打开Email
应用程序(已发送、发件箱、垃圾邮件、垃圾邮件等)。