本文整理汇总了Java中com.zxy.recovery.core.Recovery类的典型用法代码示例。如果您正苦于以下问题:Java Recovery类的具体用法?Java Recovery怎么用?Java Recovery使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Recovery类属于com.zxy.recovery.core包,在下文中一共展示了Recovery类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import com.zxy.recovery.core.Recovery; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
app=this;
getScreen(this);
Fresco.initialize(this);
Recovery.getInstance()
.debug(true)
.recoverInBackground(false)
.recoverStack(true)
.mainPage(MainActivity.class)
.init(this);
String[] urls = getResources().getStringArray(R.array.url);
String[] tips = getResources().getStringArray(R.array.title);
List list = Arrays.asList(urls);
images = new ArrayList(list);
List list1 = Arrays.asList(tips);
titles= new ArrayList(list1);
}
示例2: initBanner
import com.zxy.recovery.core.Recovery; //导入依赖的package包/类
private void initBanner() {
H = getScreenH(this);
Recovery.getInstance()
.debug(true)
.recoverInBackground(false)
.recoverStack(true)
.mainPage(MainActivity.class)
.init(this);
String[] urls = getResources().getStringArray(R.array.url4);
String[] tips = getResources().getStringArray(R.array.title);
List list = Arrays.asList(urls);
images = new ArrayList<>(list);
Log.d("Photo","images.size:" + images.size());
titles= Arrays.asList(tips);
}
示例3: onCreate
import com.zxy.recovery.core.Recovery; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
Log.e("zxy", "Recovery: init");
Recovery.getInstance()
.debug(true)
.recoverInBackground(false)
.recoverStack(true)
.mainPage(MainActivity.class)
.recoverEnabled(true)
.callback(new MyCrashCallback())
.silent(false, Recovery.SilentMode.RECOVER_ACTIVITY_STACK)
.skip(TestActivity.class)
.init(this);
MyCrashHandler.register();
}
示例4: onActivityStarted
import com.zxy.recovery.core.Recovery; //导入依赖的package包/类
@Override
public void onActivityStarted(final Activity activity) {
boolean isLegal = RecoveryStore.getInstance().verifyActivity(activity);
if (!isLegal)
return;
if (activity.getIntent().getBooleanExtra(RecoveryActivity.RECOVERY_MODE_ACTIVE, false)) {
Reflect.on(Recovery.class).method("registerRecoveryProxy").invoke(Recovery.getInstance());
}
if (RecoveryStore.getInstance().contains(activity))
return;
Window window = activity.getWindow();
if (window != null) {
View decorView = window.getDecorView();
if (decorView == null)
return;
decorView.post(new Runnable() {
@Override
public void run() {
RecoveryStore.getInstance().putActivity(activity);
Object o = activity.getIntent().clone();
RecoveryStore.getInstance().setIntent((Intent) o);
}
});
}
}
示例5: saveCrashData
import com.zxy.recovery.core.Recovery; //导入依赖的package包/类
private static void saveCrashData(CrashData data) {
if (data == null)
return;
SharedPreferencesCompat.newBuilder(Recovery.getInstance().getContext(), SHARED_PREFS_NAME)
.put(CRASH_COUNT, String.valueOf(data.crashCount))
.put(CRASH_TIME, String.valueOf(data.crashTime))
.put(SHOULD_RESTART_APP, String.valueOf(data.shouldRestart))
.apply();
}
示例6: getExternalDataDir
import com.zxy.recovery.core.Recovery; //导入依赖的package包/类
private static File getExternalDataDir() {
File file = null;
if (Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())) {
file = Recovery.getInstance().getContext().getExternalCacheDir();
}
return file == null ? null : file.getParentFile();
}
示例7: saveCrashData
import com.zxy.recovery.core.Recovery; //导入依赖的package包/类
private static void saveCrashData(CrashData data) {
if (data == null)
return;
SharedPreferencesCompat.newBuilder(Recovery.getInstance().getContext(), SHARED_PREFS_NAME)
.put(CRASH_COUNT, String.valueOf(data.crashCount))
.put(CRASH_TIME, String.valueOf(data.crashTime))
.put(SHOULD_CLEAR_APP_AND_NOT_RESTART, String.valueOf(data.shouldRestart))
.apply();
}
示例8: e
import com.zxy.recovery.core.Recovery; //导入依赖的package包/类
public static void e(String message) {
if (Recovery.getInstance().isDebug())
Log.e(TAG, message);
}
示例9: clear
import com.zxy.recovery.core.Recovery; //导入依赖的package包/类
public static void clear() {
SharedPreferencesCompat.clear(Recovery.getInstance().getContext(), SHARED_PREFS_NAME);
}
示例10: put
import com.zxy.recovery.core.Recovery; //导入依赖的package包/类
private static void put(String key, String value) {
SharedPreferencesCompat.put(Recovery.getInstance().getContext(), SHARED_PREFS_NAME, key, value);
}
示例11: get
import com.zxy.recovery.core.Recovery; //导入依赖的package包/类
private static String get(String key, String defValue) {
return SharedPreferencesCompat.get(Recovery.getInstance().getContext(), SHARED_PREFS_NAME, key, defValue);
}
示例12: getDataDir
import com.zxy.recovery.core.Recovery; //导入依赖的package包/类
private static File getDataDir() {
return new File(File.separator + "data" + File.separator + "data" + File.separator + Recovery.getInstance().getContext().getPackageName());
}