当我们需要在Android中发送电子邮件时,我们将使用如下的Intent.ACTION_SEND调用已注册的电子邮件应用程序
Intent i = new Intent(Intent.ACTION_SEND);
startActivity(Intent.createChooser(i, "Send mail..."));
Run Code Online (Sandbox Code Playgroud)
我怀疑为什么我们需要在startActivity中使用Intent.createChooser而不是使用
startActivty(i).使用有什么具体原因Intent.createChooser()吗?
我已经开发了一个Android应用程序,用于接收来自特定号码的短信。它可以将短信标记为从该号码读取。要将短信标记为已读,需要将应用程序设置为默认值。如何在Android中以编程方式将应用设置为默认设置?