Android手机应用程序的意图 [英] Android phone application intent

查看:99
本文介绍了Android手机应用程序的意图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要启动手机上的手机应用程序的意图

I want to launch the phone application on the phone as an intent

我用这code

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

但功能抛出一个空指针excaption所以没有可启动itent但如何启动它使用户观看telephonylogs

but the function throws an nullpointer excaption so there is no launchable itent but how can i launch it to make the user watch the telephonylogs

推荐答案

您需要特定的一些权限...更好做。

You need permissions for certain ones ...better off doing

  Intent intent = new Intent(Intent.ACTION_MAIN, null);
 intent.addCategory(Intent.CATEGORY_LAUNCHER);
     List<ResolveInfo> packs = mContext.getPackageManager().queryIntentActivities(intent,     PackageManager.PERMISSION_GRANTED);

,然后你得到了你有权限,然后排序通过这个启动事情的清单。

and then you got the list of things you have permission for and then sort through this to launch.

这篇关于Android手机应用程序的意图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆