我想从我的应用程序打开Google日历应用程序.我有以下代码,但它崩溃了:
if (Utils.isPackageInstalled(PACKAGEname,getApplicationContext())) { intent = new Intent(Intent.ACTION_VIEW, Uri.parse( "com.androID.calendar")); startActivity(intent);}
LogCat:
04-30 09:14:29.156: E/AndroIDRuntime(21225): FATAL EXCEPTION: main04-30 09:14:29.156: E/AndroIDRuntime(21225): Process: com.am, PID: 2122504-30 09:14:29.156: E/AndroIDRuntime(21225): androID.content.ActivityNotFoundException: No Activity found to handle Intent { act=androID.intent.action.VIEW dat=com.androID.calendar }04-30 09:14:29.156: E/AndroIDRuntime(21225): at androID.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1632)04-30 09:14:29.156: E/AndroIDRuntime(21225): at androID.app.Instrumentation.execStartActivity(Instrumentation.java:1424)04-30 09:14:29.156: E/AndroIDRuntime(21225): at androID.app.Activity.startActivityForResult(Activity.java:3424)04-30 09:14:29.156: E/AndroIDRuntime(21225): at androID.app.Activity.startActivityForResult(Activity.java:3385)04-30 09:14:29.156: E/AndroIDRuntime(21225): at androID.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:839)04-30 09:14:29.156: E/AndroIDRuntime(21225): at androID.app.Activity.startActivity(Activity.java:3627)04-30 09:14:29.156: E/AndroIDRuntime(21225): at androID.app.Activity.startActivity(Activity.java:3595)04-30 09:14:29.156: E/AndroIDRuntime(21225): at com.amexbarcelo.activity.RootActiveTravel.onClick(RootActiveTravel.java:147)04-30 09:14:29.156: E/AndroIDRuntime(21225): at com.androID.internal.app.AlertController$buttonHandler.handleMessage(AlertController.java:166)04-30 09:14:29.156: E/AndroIDRuntime(21225): at androID.os.Handler.dispatchMessage(Handler.java:102)04-30 09:14:29.156: E/AndroIDRuntime(21225): at androID.os.Looper.loop(Looper.java:136)04-30 09:14:29.156: E/AndroIDRuntime(21225): at androID.app.ActivityThread.main(ActivityThread.java:5017)04-30 09:14:29.156: E/AndroIDRuntime(21225): at java.lang.reflect.Method.invokeNative(Native Method)04-30 09:14:29.156: E/AndroIDRuntime(21225): at java.lang.reflect.Method.invoke(Method.java:515)04-30 09:14:29.156: E/AndroIDRuntime(21225): at com.androID.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)04-30 09:14:29.156: E/AndroIDRuntime(21225): at com.androID.internal.os.ZygoteInit.main(ZygoteInit.java:595)04-30 09:14:29.156: E/AndroIDRuntime(21225): at dalvik.system.NativeStart.main(Native Method)
解决方法:
不建议将软件包名称用于第三方应用程序以进行启动.您必须指定 *** 作和URI,并让系统找到最佳应用程序来处理请求.
> Android Docs on using Calendar Intent,
> How to use Calendar Intent?,
> What You Need to Know About the Intents of Android’s Calendar App
以上是内存溢出为你收集整理的android-如何从我的应用程序打开google calendar应用程序?全部内容,希望文章能够帮你解决android-如何从我的应用程序打开google calendar应用程序?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)