资源简介
Android崩溃时,使用自己的错误页面,提高友好度
代码片段和文件信息
/*
* Copyright 2015 Eduard Ereza Martínez
*
* Licensed under the Apache License Version 2.0 (the “License“);
* you may not use this file except in compliance with the License.
*
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing software
* distributed under the License is distributed on an “AS IS“ BASIS
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cat.ereza.customactivityoncrash;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import java.io.PrintWriter;
import java.io.Serializable;
import java.io.StringWriter;
import java.lang.ref.WeakReference;
import java.lang.reflect.Modifier;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import cat.ereza.customactivityoncrash.activity.DefaultErrorActivity;
@SuppressLint(“NewApi“)
public final class CustomActivityOnCrash {
private final static String TAG = “CustomActivityOnCrash“;
//Extras passed to the error activity
private static final String EXTRA_RESTART_ACTIVITY_CLASS = “cat.ereza.customactivityoncrash.EXTRA_RESTART_ACTIVITY_CLASS“;
private static final String EXTRA_SHOW_ERROR_DETAILS = “cat.ereza.customactivityoncrash.EXTRA_SHOW_ERROR_DETAILS“;
private static final String EXTRA_STACK_TRACE = “cat.ereza.customactivityoncrash.EXTRA_STACK_TRACE“;
private static final String EXTRA_IMAGE_DRAWABLE_ID = “cat.ereza.customactivityoncrash.EXTRA_IMAGE_DRAWABLE_ID“;
private static final String EXTRA_EVENT_LISTENER = “cat.ereza.customactivityoncrash.EXTRA_EVENT_LISTENER“;
//General constants
private static final String INTENT_ACTION_ERROR_ACTIVITY = “cat.ereza.customactivityoncrash.ERROR“;
private static final String INTENT_ACTION_RESTART_ACTIVITY = “cat.ereza.customactivityoncrash.RESTART“;
private static final String CAOC_HANDLER_PACKAGE_NAME = “cat.ereza.customactivityoncrash“;
private static final String DEFAULT_HANDLER_PACKAGE_NAME = “com.android.internal.os“;
private static final int MAX_STACK_TRACE_SIZE = 131071; //128 KB - 1
private static final int TIMESTAMP_DIFFERENCE_TO_AVOID_RESTART_LOOPS_IN_MILLIS = 2000;
//Shared preferences
private static final String SHARED_PREFERENCES_FILE = “custom_activity_on_crash“;
private static final String SHARED_PREFERENCES_FIELD_TIMESTAMP = “las
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2016-03-09 20:32 CustomActivityOnCrash-master\
文件 76 2016-03-09 20:32 CustomActivityOnCrash-master\.gitignore
文件 11357 2016-03-09 20:32 CustomActivityOnCrash-master\LICENSE
文件 224 2016-03-09 20:32 CustomActivityOnCrash-master\NOTICE
文件 11571 2016-03-09 20:32 CustomActivityOnCrash-master\README.md
文件 1039 2016-03-09 20:32 CustomActivityOnCrash-master\build.gradle
文件 1537 2016-03-09 20:32 CustomActivityOnCrash-master\gradle.properties
目录 0 2016-03-09 20:32 CustomActivityOnCrash-master\gradle\
目录 0 2016-03-09 20:32 CustomActivityOnCrash-master\gradle\wrapper\
文件 49896 2016-03-09 20:32 CustomActivityOnCrash-master\gradle\wrapper\gradle-wrapper.jar
文件 232 2016-03-09 20:32 CustomActivityOnCrash-master\gradle\wrapper\gradle-wrapper.properties
文件 5080 2016-03-09 20:32 CustomActivityOnCrash-master\gradlew
文件 2314 2016-03-09 20:32 CustomActivityOnCrash-master\gradlew.bat
目录 0 2016-03-09 20:32 CustomActivityOnCrash-master\images\
文件 34025 2016-03-09 20:32 CustomActivityOnCrash-master\images\frontpage.png
目录 0 2016-03-09 20:32 CustomActivityOnCrash-master\library\
文件 7 2016-03-09 20:32 CustomActivityOnCrash-master\library\.gitignore
文件 978 2016-03-09 20:32 CustomActivityOnCrash-master\library\build.gradle
文件 684 2016-03-09 20:32 CustomActivityOnCrash-master\library\gradle.properties
目录 0 2016-03-09 20:32 CustomActivityOnCrash-master\library\src\
目录 0 2016-03-09 20:32 CustomActivityOnCrash-master\library\src\main\
文件 1010 2016-03-09 20:32 CustomActivityOnCrash-master\library\src\main\AndroidManifest.xm
目录 0 2016-03-09 20:32 CustomActivityOnCrash-master\library\src\main\java\
目录 0 2016-03-09 20:32 CustomActivityOnCrash-master\library\src\main\java\cat\
目录 0 2016-03-09 20:32 CustomActivityOnCrash-master\library\src\main\java\cat\ereza\
目录 0 2016-03-09 20:32 CustomActivityOnCrash-master\library\src\main\java\cat\ereza\customactivityoncrash\
文件 37423 2016-03-09 20:32 CustomActivityOnCrash-master\library\src\main\java\cat\ereza\customactivityoncrash\CustomActivityOnCrash.java
目录 0 2016-03-09 20:32 CustomActivityOnCrash-master\library\src\main\java\cat\ereza\customactivityoncrash\activity\
文件 6247 2016-03-09 20:32 CustomActivityOnCrash-master\library\src\main\java\cat\ereza\customactivityoncrash\activity\DefaultErrorActivity.java
目录 0 2016-03-09 20:32 CustomActivityOnCrash-master\library\src\main\res\
目录 0 2016-03-09 20:32 CustomActivityOnCrash-master\library\src\main\res\drawable-hdpi\
............此处省略58个文件信息
相关资源
- Android自定义锁屏实现----仿正点闹钟滑
- Android中获取正在运行的应用程序Act
- Android 心电图
- android平台联系人管理应用源码+项目项
- dtmf decoder Android rar
- Android开发 心电图绘制
- android listview点击保持背景颜色,实现
- android蓝牙聊天源代码
- android室内定位demo
- QWebSocket-for-Android-openssl库
- Android 通过摄像头检测心率
- androidannotations-api-4.4.0.jar
- Android多级下拉列表菜单
- android版本更新
- 《Android应用开发》课程标准
- zipentry工具类
- AndroidUI界面模板
- Android应用控制LED动态编译
- Android TCP_Client
- wget 完整版 for android 支持Android8.0 aa
- 4000套android源码,2058套ios源码,存在
- android背单词源代码
- DownDemo.zip
- 科大讯飞6麦CAE集成指南_android_V1.2
- 手机应用管理器的实现完整版
- 图中找图对比,Java源代码,Android源代
- Android Studio 字体主题样式包
- android系统内置数据库字段描述
- Android手机遥控智能小车源码
- android选择图片或拍照图片上传到服务
评论
共有 条评论