本文整理汇总了Java中cat.ereza.customactivityoncrash.CustomActivityOnCrash类的典型用法代码示例。如果您正苦于以下问题:Java CustomActivityOnCrash类的具体用法?Java CustomActivityOnCrash怎么用?Java CustomActivityOnCrash使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CustomActivityOnCrash类属于cat.ereza.customactivityoncrash包,在下文中一共展示了CustomActivityOnCrash类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import cat.ereza.customactivityoncrash.CustomActivityOnCrash; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
CustomActivityOnCrash.install(this);
//初始化日志
XFrame.initXLog();
//初始化多状态界面View
XFrame.initXLoadingView()
.setErrorViewResId(R.layout._loading_layout_error);
/**
初始化网络请求的引擎,在这里可以一行代码切换,避免更换网络框架麻烦的问题
提供三种常见框架的简单案例:(你也可以按照例子自己实现)
AsyncHttpEngine、OKHttpEngine、VolleyHttpEngine
*/
XFrame.initXHttp(new AsyncHttpEngine());
/**
* 初始化全局图片加载框架
* GlideImageLoader为你的图片加载框架实现类
*/
XFrame.initXImageLoader(new GlideImageLoader(getApplicationContext()));
}
示例2: onCreate
import cat.ereza.customactivityoncrash.CustomActivityOnCrash; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
mContext = this;
//Install CustomActivityOnCrash
CustomActivityOnCrash.install(this);
CustomActivityOnCrash.setErrorActivityClass(ErrorActivity.class);
//Now initialize your error handlers as normal
//i.e., ACRA.init(this);
//or Fabric.with(this, new Crashlytics())
// Bugly.init(getApplicationContext(), "900037586", false);
/*ImageLoader.getInstance().init(new ImageLoaderConfiguration.Builder(this)
.memoryCache(new WeakMemoryCache())
.imageDownloader(new AuthImageDownloader(this)).threadPoolSize(7).build());*/
Fresco.initialize(this);
//init logUtil
LogUtil.setDebugOn(true);
LogUtil.setDebugLevel(5);
}
示例3: onCreate
import cat.ereza.customactivityoncrash.CustomActivityOnCrash; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
CustomActivityOnCrash.install(this);
EventBus.getDefault().register(this);
EasyImage.configuration(this)
.saveInRootPicturesDirectory()
.setImagesFolderName(getString(R.string.app_name));
Nammu.init(this);
Paper.init(this);
Typekit.getInstance()
.addNormal(Typekit.createFromAsset(this, "fonts/LatoLatin-Regular.ttf"))
.addBold(Typekit.createFromAsset(this, "fonts/LatoLatin-Bold.ttf"))
.addItalic(Typekit.createFromAsset(this, "fonts/LatoLatin-Italic.ttf"))
.addBoldItalic(Typekit.createFromAsset(this, "fonts/LatoLatin-BoldItalic.ttf"))
.addCustom1(Typekit.createFromAsset(this, "fonts/Geomanist-Regular.otf"))
.addCustom2(Typekit.createFromAsset(this, "fonts/Handlee-Regular.ttf"));
initFabric();
initParse();
}
示例4: create
import cat.ereza.customactivityoncrash.CustomActivityOnCrash; //导入依赖的package包/类
@NonNull
public static Builder create() {
Builder builder = new Builder();
CaocConfig currentConfig = CustomActivityOnCrash.getConfig();
CaocConfig config = new CaocConfig();
config.backgroundMode = currentConfig.backgroundMode;
config.enabled = currentConfig.enabled;
config.showErrorDetails = currentConfig.showErrorDetails;
config.showRestartButton = currentConfig.showRestartButton;
config.logErrorOnRestart = currentConfig.logErrorOnRestart;
config.trackActivities = currentConfig.trackActivities;
config.minTimeBetweenCrashesMs = currentConfig.minTimeBetweenCrashesMs;
config.errorDrawable = currentConfig.errorDrawable;
config.errorActivityClass = currentConfig.errorActivityClass;
config.restartActivityClass = currentConfig.restartActivityClass;
config.eventListener = currentConfig.eventListener;
builder.config = config;
return builder;
}
示例5: copyErrorToClipboard
import cat.ereza.customactivityoncrash.CustomActivityOnCrash; //导入依赖的package包/类
private void copyErrorToClipboard() {
String errorInformation = CustomActivityOnCrash.getAllErrorDetailsFromIntent(CrashErrorActivity.this, getIntent());
ClipboardManager clipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
ClipData clip = ClipData.newPlainText(getString(R.string.customactivityoncrash_error_activity_error_details_clipboard_label), errorInformation);
if (clipboard != null) {
clipboard.setPrimaryClip(clip);
}
}
示例6: init
import cat.ereza.customactivityoncrash.CustomActivityOnCrash; //导入依赖的package包/类
public static void init( Context app) {
// 初始化Bugly
if (!BuildConfig.DEBUG) {
// 获取当前包名
String packageName = app.getPackageName();
// 获取当前进程名
String processName = SysUtils.getProcessName(android.os.Process.myPid());
// 设置是否为上报进程
CrashReport.UserStrategy strategy = new CrashReport.UserStrategy(app);
strategy.setUploadProcess(processName == null || processName.equals(packageName));
CrashReport.initCrashReport(app.getApplicationContext(),app.getString(R.string.bugly_app_id), false, strategy);
} else {
if (app.getResources().getBoolean(R.bool.crash_logger_enable)) {
Thread.currentThread()
.setUncaughtExceptionHandler(new CrashLogger(getAppContext()));
} else {
try{
CustomActivityOnCrash.install(app);
}catch (Exception e){
Log.e(e,"CrashReportConfig on CustomActivityOnCrash init");
}
}
}
}
示例7: onCreate
import cat.ereza.customactivityoncrash.CustomActivityOnCrash; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
CustomActivityOnCrash.install(this);
if (LeakCanary.isInAnalyzerProcess(this)) {
return;
}
LeakCanary.install(this);
}
示例8: onCreate
import cat.ereza.customactivityoncrash.CustomActivityOnCrash; //导入依赖的package包/类
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_error_view);
initViews();
initImmerse();
Log.e(TAG, CustomActivityOnCrash.getAllErrorDetailsFromIntent(ErrorActivity.this, getIntent()));
}
示例9: onCreate
import cat.ereza.customactivityoncrash.CustomActivityOnCrash; //导入依赖的package包/类
@Override public void onCreate() {
super.onCreate();
instance = this;
PrefHelper.init(this);
TypeFaceHelper.generateTypeface(this);
CustomActivityOnCrash.setRestartActivityClass(MainView.class);
CustomActivityOnCrash.setShowErrorDetails(DEBUG);
CustomActivityOnCrash.install(this);
FacebookSdk.sdkInitialize(getApplicationContext());
FirebaseDatabase.getInstance().setPersistenceEnabled(true);
}
示例10: onCreate
import cat.ereza.customactivityoncrash.CustomActivityOnCrash; //导入依赖的package包/类
@Override public void onCreate() {
super.onCreate();
instance = this;
FileHelper.initFolderName(getString(R.string.app_name));
PrefHelper.init(this);
TypeFaceHelper.generateTypeface(this);
CustomActivityOnCrash.setRestartActivityClass(MainView.class);
CustomActivityOnCrash.setShowErrorDetails(BuildConfig.DEBUG);
CustomActivityOnCrash.install(this);
}
示例11: onCreate
import cat.ereza.customactivityoncrash.CustomActivityOnCrash; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
sAppComponent = DaggerAppComponent.builder().appModule(new AppModule(this)).build();
sAppComponent.inject(this);
if (BuildConfig.DEBUG || mSetting.isCatchCrashEnable()) {
CustomActivityOnCrash.install(this);
}
}
示例12: onCreate
import cat.ereza.customactivityoncrash.CustomActivityOnCrash; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
CustomActivityOnCrash.install(this);
if (getSharedPreferences("data", MODE_PRIVATE).getInt("DataVersion", 1) != 3 && getSharedPreferences("data", MODE_PRIVATE).getBoolean("LoggedIn", false)) {
relogin = true;
Toast.makeText(StartActivity.this, getString(R.string.msg_old_version), Toast.LENGTH_LONG).show();
startActivity(new Intent(this, SetupActivity.class));
finish();
}
if (!getSharedPreferences("data", MODE_PRIVATE).getBoolean("LoggedIn", false) || relogin) {
startActivity(new Intent(this, SetupActivity.class));
finish();
} else if (!relogin) {
ConfigUtil configUtil = new ConfigUtil(getApplicationContext());
if (!ServiceUtil.isMyServiceRunning(AppointmentService.class, this) && configUtil.getBoolean("notification")) {
startService(new Intent(this, AppointmentService.class));
}
if (!ServiceUtil.isMyServiceRunning(AutoSilentService.class, this) && configUtil.getBoolean("auto-silent")) {
startService(new Intent(this, AutoSilentService.class));
}
//startService(new Intent(this, NewGradeService.class));
startActivity(new Intent(this, CalendarActivity.class));
finish();
}
}
示例13: onCreate
import cat.ereza.customactivityoncrash.CustomActivityOnCrash; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
sApplication = this;
sAppComponent = DaggerAppComponent.builder().appModule(new AppModule(this)).build();
sAppComponent.inject(this);
CustomActivityOnCrash.install(this);
FlowManager.init(this);
}
示例14: onCreate
import cat.ereza.customactivityoncrash.CustomActivityOnCrash; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
controller = this;
CustomActivityOnCrash.setRestartActivityClass(Home.class);
CustomActivityOnCrash.install(this);
Crashlytics crashlytics = new Crashlytics.Builder().disabled(BuildConfig.DEBUG).build();
Fabric.with(this, crashlytics);
mIconCache = new IconCache(this);
}
示例15: copyErrorToClipboard
import cat.ereza.customactivityoncrash.CustomActivityOnCrash; //导入依赖的package包/类
private void copyErrorToClipboard() {
String errorInformation = CustomActivityOnCrash.getAllErrorDetailsFromIntent(DefaultErrorActivity.this, getIntent());
ClipboardManager clipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
//Are there any devices without clipboard...?
if (clipboard != null) {
ClipData clip = ClipData.newPlainText(getString(R.string.customactivityoncrash_error_activity_error_details_clipboard_label), errorInformation);
clipboard.setPrimaryClip(clip);
Toast.makeText(DefaultErrorActivity.this, R.string.customactivityoncrash_error_activity_error_details_copied, Toast.LENGTH_SHORT).show();
}
}