Android手机应用 Intent

标签 android android-intent

我想在手机上启动手机应用程序作为 intent

我正在使用这个代码

startActivity(getPackageManager().getLaunchIntentForPackage("com.android.phone"));

但该函数抛出空指针异常,因此没有可启动的 itent,但我如何启动它才能让用户观看电话日志

最佳答案

我设法回答了我的问题,感谢您的回答,虽然没有完全满足我想要的,但在此基础上我想通了

我只需要打电话

Intent intent = new Intent(Intent.ACTION_DIAL);

startActivity(intent);

只打开手机应用

关于Android手机应用 Intent ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11038286/

相关文章:

android - 如何在 Android 上管理 startActivityForResult

android - 为什么错误 "Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag"只发生在某些设备上?

android - Android 的复制保护如何检查设备是否已 Root ?

java - sqlite 中按两列排序

android - 我无法将 int 值从一项 Activity 转移到另一项 Activity

android - 将数据从一个 Activity 传递到另一个 Activity

android - 通过 SSH 隧道引导所有 android 流量

android - 如何在特定时间内填充进度条?

android - 是否可以使用私有(private) Intent 而不是全局 Intent ?

java - 如何在android的拨号器(默认或股票拨号器)中启动服务