当前位置: 首页>>代码示例>>Java>>正文


Java CustomActivityOnCrash类代码示例

本文整理汇总了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()));
}
 
开发者ID:youth5201314,项目名称:XFrame,代码行数:25,代码来源:App.java

示例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);
}
 
开发者ID:wuyr,项目名称:LuZhiShen,代码行数:20,代码来源:Application.java

示例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();
}
 
开发者ID:adrielcafe,项目名称:NMSAlphabetAndroidApp,代码行数:22,代码来源:App.java

示例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;
}
 
开发者ID:Ereza,项目名称:CustomActivityOnCrash,代码行数:23,代码来源:CaocConfig.java

示例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);
    }
}
 
开发者ID:alphater,项目名称:garras,代码行数:10,代码来源:CrashErrorActivity.java

示例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");
            }

        }

    }

}
 
开发者ID:wzx54321,项目名称:XinFramework,代码行数:28,代码来源:CrashReportConfig.java

示例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);
}
 
开发者ID:BigSea001,项目名称:PhotoPickApp,代码行数:12,代码来源:MyApp.java

示例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()));
}
 
开发者ID:wuyr,项目名称:LuZhiShen,代码行数:9,代码来源:ErrorActivity.java

示例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);
}
 
开发者ID:k0shk0sh,项目名称:Cheaphlight,代码行数:12,代码来源:App.java

示例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);
}
 
开发者ID:k0shk0sh,项目名称:NewKam,代码行数:11,代码来源:App.java

示例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);
    }
}
 
开发者ID:xdtianyu,项目名称:Gallery,代码行数:12,代码来源:Application.java

示例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();
    }
}
 
开发者ID:Z3r0byte,项目名称:Magis,代码行数:29,代码来源:StartActivity.java

示例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);
}
 
开发者ID:kurumi-moe,项目名称:MoeGallery,代码行数:13,代码来源:Application.java

示例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);
}
 
开发者ID:k0shk0sh,项目名称:KAM,代码行数:11,代码来源:AppController.java

示例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();
    }
}
 
开发者ID:Ereza,项目名称:CustomActivityOnCrash,代码行数:13,代码来源:DefaultErrorActivity.java


注:本文中的cat.ereza.customactivityoncrash.CustomActivityOnCrash类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。