UncaughtException不让Android应用异常退出

上传者: wangduanqing5945 | 上传时间: 2021-03-26 16:53:23 | 文件大小: 1022KB | 文件类型: ZIP
使用android:process和Process.killProcess和UncaughtExceptionHandler完成Android应用程序不异常退出

文件下载

资源详情

[{"title":"( 52 个子文件 1022KB ) UncaughtException不让Android应用异常退出","children":[{"title":"TestUncaughtException","children":[{"title":".project <span style='color:#111;'> 857B </span>","children":null,"spread":false},{"title":"project.properties <span style='color:#111;'> 562B </span>","children":null,"spread":false},{"title":"src","children":[{"title":"duanqing","children":[{"title":"test","children":[{"title":"uncaughtexception","children":[{"title":"ReportPage.java <span style='color:#111;'> 1.73KB </span>","children":null,"spread":false},{"title":"MainActivity.java <span style='color:#111;'> 929B </span>","children":null,"spread":false},{"title":"ThirdActivity.java <span style='color:#111;'> 1009B </span>","children":null,"spread":false},{"title":"SecondActivity.java <span style='color:#111;'> 1016B </span>","children":null,"spread":false},{"title":"MyExceptionHanlder.java <span style='color:#111;'> 2.57KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":"AndroidManifest.xml <span style='color:#111;'> 1.21KB </span>","children":null,"spread":false},{"title":"res","children":[{"title":"drawable-ldpi","children":null,"spread":false},{"title":"drawable-hdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 7.48KB </span>","children":null,"spread":false}],"spread":true},{"title":"menu","children":[{"title":"main.xml <span style='color:#111;'> 223B </span>","children":null,"spread":false}],"spread":true},{"title":"drawable-mdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 3.69KB </span>","children":null,"spread":false}],"spread":true},{"title":"layout","children":[{"title":"activity_main.xml <span style='color:#111;'> 869B </span>","children":null,"spread":false},{"title":"activity_report.xml <span style='color:#111;'> 1.35KB </span>","children":null,"spread":false}],"spread":true},{"title":"values-sw600dp","children":[{"title":"dimens.xml <span style='color:#111;'> 201B </span>","children":null,"spread":false}],"spread":true},{"title":"drawable-xxhdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 24.20KB </span>","children":null,"spread":false}],"spread":true},{"title":"drawable-xhdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 12.22KB </span>","children":null,"spread":false}],"spread":true},{"title":"values","children":[{"title":"strings.xml <span style='color:#111;'> 468B </span>","children":null,"spread":false},{"title":"styles.xml <span style='color:#111;'> 695B </span>","children":null,"spread":false},{"title":"dimens.xml <span style='color:#111;'> 218B </span>","children":null,"spread":false}],"spread":false},{"title":"values-sw720dp-land","children":[{"title":"dimens.xml <span style='color:#111;'> 275B </span>","children":null,"spread":false}],"spread":false}],"spread":true},{"title":"assets","children":null,"spread":false},{"title":"gen","children":[{"title":"duanqing","children":[{"title":"test","children":[{"title":"uncaughtexception","children":[{"title":"BuildConfig.java <span style='color:#111;'> 173B </span>","children":null,"spread":false},{"title":"R.java <span style='color:#111;'> 2.50KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":"libs","children":[{"title":"android-support-v4.jar <span style='color:#111;'> 383.94KB </span>","children":null,"spread":false}],"spread":true},{"title":".classpath <span style='color:#111;'> 364B </span>","children":null,"spread":false},{"title":"proguard-project.txt <span style='color:#111;'> 781B </span>","children":null,"spread":false},{"title":"ic_launcher-web.png <span style='color:#111;'> 50.19KB </span>","children":null,"spread":false},{"title":"bin","children":[{"title":"resources.ap_ <span style='color:#111;'> 41.03KB </span>","children":null,"spread":false},{"title":"classes","children":[{"title":"duanqing","children":[{"title":"test","children":[{"title":"uncaughtexception","children":[{"title":"R$layout.class <span style='color:#111;'> 481B </span>","children":null,"spread":false},{"title":"R$style.class <span style='color:#111;'> 470B </span>","children":null,"spread":false},{"title":"R$dimen.class <span style='color:#111;'> 500B </span>","children":null,"spread":false},{"title":"BuildConfig.class <span style='color:#111;'> 371B </span>","children":null,"spread":false},{"title":"R$drawable.class <span style='color:#111;'> 446B </span>","children":null,"spread":false},{"title":"R$attr.class <span style='color:#111;'> 379B </span>","children":null,"spread":false},{"title":"ReportPage.class <span style='color:#111;'> 2.25KB </span>","children":null,"spread":false},{"title":"ThirdActivity.class <span style='color:#111;'> 1.61KB </span>","children":null,"spread":false},{"title":"R$id.class <span style='color:#111;'> 556B </span>","children":null,"spread":false},{"title":"R.class <span style='color:#111;'> 803B </span>","children":null,"spread":false},{"title":"R$string.class <span style='color:#111;'> 640B </span>","children":null,"spread":false},{"title":"SecondActivity.class <span style='color:#111;'> 1.81KB </span>","children":null,"spread":false},{"title":"R$menu.class <span style='color:#111;'> 427B </span>","children":null,"spread":false},{"title":"MainActivity.class <span style='color:#111;'> 1.61KB </span>","children":null,"spread":false},{"title":"MyExceptionHanlder.class <span style='color:#111;'> 3.12KB </span>","children":null,"spread":false}],"spread":false}],"spread":false}],"spread":false}],"spread":false},{"title":"AndroidManifest.xml <span style='color:#111;'> 1.21KB </span>","children":null,"spread":false},{"title":"dexedLibs","children":[{"title":"android-support-v4-1cdb5271c8146934bccd2ede43e738bd.jar <span style='color:#111;'> 148.28KB </span>","children":null,"spread":false},{"title":"annotations-3813676a8b579d8651b2c7fca12352c8.jar <span style='color:#111;'> 943B </span>","children":null,"spread":false}],"spread":false},{"title":"jarlist.cache <span style='color:#111;'> 119B </span>","children":null,"spread":false},{"title":"res","children":[{"title":"drawable-hdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 5.82KB </span>","children":null,"spread":false}],"spread":false},{"title":"drawable-mdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 3.04KB </span>","children":null,"spread":false}],"spread":false},{"title":"drawable-xxhdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 17.47KB </span>","children":null,"spread":false}],"spread":false},{"title":"drawable-xhdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 9.14KB </span>","children":null,"spread":false}],"spread":false}],"spread":false},{"title":"classes.dex <span style='color:#111;'> 577.70KB </span>","children":null,"spread":false},{"title":"TestUncaughtException.apk <span style='color:#111;'> 194.84KB </span>","children":null,"spread":false}],"spread":true}],"spread":false}],"spread":true}]

评论信息

  • gwyon :
    运行试了一下发现这种方法实际上重启了app并且重启Activit的intent不变,对于需要保存其他状态的程序还是比较麻烦的
    2017-03-15
  • HarryZhang :
    这个帮助我很大,谢谢
    2017-03-04
  • 任笑 :
    安卓应用 的经常无故退出 是比较烦人的。
    2016-10-24
  • schzpl :
    亲测,确实可以用,值得借鉴
    2015-11-19
  • sinat_23013943 :
    不错,我是为积分来的,见谅
    2015-10-27
  • wu_liao_de_ren_sheng :
    很好,可以加到项目里
    2015-08-04
  • huohu1007 :
    很不错的代码,值得学习
    2015-07-26
  • lottepie_bingo :
    不错,很有帮助,解决了我的问题
    2015-06-02
  • de8878845 :
    对我有借鉴的作用OK
    2015-01-30
  • fengyongpeng :
    有点太简单了,不过新手拿来学习还是可以参考下
    2015-01-04

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明