android-如何从我的应用程序打开google calendar应用程序?
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了android-如何从我的应用程序打开google calendar应用程序?,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2778字,纯文字阅读大概需要4分钟。
内容图文
![android-如何从我的应用程序打开google calendar应用程序?](/upload/InfoBanner/zyjiaocheng/679/7a79a9d43dd24aebb98cf2410de4b9f9.jpg)
我想从我的应用程序打开Goog??le日历应用程序.我有以下代码,但它崩溃了:
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: main
04-30 09:14:29.156: E/AndroidRuntime(21225): Process: com.am, PID: 21225
04-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$4.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应用程序?所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。