在三星Galaxy S3上调用任何明确的意图(例如相机/图库,通话或共享)时,Android应用程序崩溃 [英] Android app crashes when calling any explicit intent (like camera/gallery, call or share) on Samsung galaxy s3

查看:100
本文介绍了在三星Galaxy S3上调用任何明确的意图(例如相机/图库,通话或共享)时,Android应用程序崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有compileSdkVersion和targetSdkVersion 23,并在三星银河s3上进行了测试.但是每当我打开任何第三方应用程序(显式意图)(例如相机/画廊应用程序)或共享意图(gmail,电子邮件)或拨号器应用程序并通过按后退按钮返回到我的应用程序时(或者在相机/画廊应用程序中通过选择图片) .应用程序从MainAcitivty重新启动(也许它已崩溃,但在logcat中未显示任何异常).这是我打开意图的方式:

I have compileSdkVersion and targetSdkVersion 23 and testing on Samsung galaxy s3. But whenever i open any third party app (explicit intent) like camera/gallery app or share intent (gmail, email) or dialer app and comeback to my app by pressing back button or (in case of camera/gallery app by selecting picture). App restarts from MainAcitivty (maybe it is getting crashed but it does not show any exception in logcat). Here is how i open intents:

通话/拨号:

Intent callIntent = new Intent(Intent.ACTION_DIAL);
callIntent.setData(Uri.parse("tel:" + phone));
context.startActivity(callIntent);

画廊:

Intent intent = new Intent(Intent.ACTION_PICK,
MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
startActivityForResult(intent, GALLERY_PIC_REQUEST);

分享:

Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_SUBJECT, subject);
context.startActivity(Intent.createChooser(intent, dialogHeaderText));

此问题仅出现在Samsung s3中.我已经在Google nexus 5,Huawei Honor 4C和Samsung galaxy s5上测试了上述所有功能,但是一切正常.有帮助吗?

This issue is only coming in Samsung s3. I have tested all above functionalities on Google nexus 5, Huawei Honor 4C and Samsung galaxy s5 it is working fine. Any help?

推荐答案

每个提到的intent应该具有回调机制,在我不得不面对的 Samsung S3 的情况下,这确实很奇怪.我已经搜索了很多,但没有找到任何东西.

Every mentioned intent should have a callback mechanism, it is really strange in Samsung S3's case where I have to face it. I have searched a lot but didn't find anything.

不知何故,我在开发人员选项中看到了一个标题为请勿保留活动的选项,该选项会在被检查时尽快销毁用户的所有活动.请确保未选中它.

Somehow, I have seen an option in Developer Options titled as Do not keet activities which destroys every activity of user as soon as possible when checked. Please make sure that it is unchecked.

我已修复了适用于Android 4.3版的Samsung S3的问题,并在许多设备和Android OS版本中发现了此选项

I have fixed it for Samsung S3 with Android version 4.3 and found that this option in many devices and Android OS versions

请按照以下步骤操作:

Android 4.3版(三星银河S3):

Android version 4.3 (Samsung galaxy S3):

  1. 转到设置 >> 更多(选项卡)>> 开发者选项 >> 不保留活动
  2. 确保未选中此选项
  1. Go to Settings >> More (Tab) >> Developer Options >> Do not keep activities
  2. Make sure this option is unchecked

常规:

  1. 转到设置 >> 开发者选项 >> 不要保留 活动
  2. 确保此选项为未选中
  1. Go to Settings >> Developer Options >> Do not keep activities
  2. Make sure this option is unchecked

希望它会起作用:)

这篇关于在三星Galaxy S3上调用任何明确的意图(例如相机/图库,通话或共享)时,Android应用程序崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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