use of com.benmu.framework.manager.StorageManager in project WeexErosFramework by bmfe.
the class EventSetHomePage method setHomePage.
@SuppressWarnings("WrongConstant")
public void setHomePage(Context context, String params) {
StorageManager storageManager = ManagerFactory.getManagerService(StorageManager.class);
storageManager.setData(context, Constant.SP.SP_HOMEPAGE_URL, params);
String homePage = BMWXEnvironment.mPlatformConfig.getPage().getHomePage(context);
RouterModel router = new RouterModel(homePage, Constant.ACTIVITIES_ANIMATION.ANIMATION_PUSH, null, null, false, null);
Intent intent = performStartActivity(router, Constant.BMPAGE_CATEGORY);
context.startActivity(intent);
// PendingIntent restartIntent = PendingIntent.getActivity(
// context.getApplicationContext(), 0, intent, Intent.FLAG_ACTIVITY_CLEAR_TASK);
// AlarmManager mgr = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
// mgr.set(AlarmManager.RTC, System.currentTimeMillis() + 100,
// restartIntent);
}
use of com.benmu.framework.manager.StorageManager in project WeexErosFramework by bmfe.
the class EventDeleteData method deleteData.
public void deleteData(Context context, ArrayList<String> paramsList, JSCallback jscallback) {
String key = paramsList.get(0);
StorageManager storageManager = ManagerFactory.getManagerService(StorageManager.class);
boolean result = storageManager.deleteData(context, key);
if (result) {
JsPoster.postSuccess(null, jscallback);
} else {
JsPoster.postFailed("删除" + key + "失败", jscallback);
}
}
use of com.benmu.framework.manager.StorageManager in project WeexErosFramework by bmfe.
the class EventGetData method getDataSync.
public Object getDataSync(Context context, ArrayList<String> list) {
String key = list.get(0);
StorageManager storageManager = ManagerFactory.getManagerService(StorageManager.class);
String result = storageManager.getData(context, key);
return result == null ? JsPoster.getFailed() : JsPoster.getSuccess(result);
}
use of com.benmu.framework.manager.StorageManager in project WeexErosFramework by bmfe.
the class EventRemoveData method removeData.
public void removeData(Context context, JSCallback jscallback) {
StorageManager storageManager = ManagerFactory.getManagerService(StorageManager.class);
boolean result = storageManager.removeData(context);
if (result) {
JsPoster.postSuccess(null, jscallback);
} else {
JsPoster.postFailed(jscallback);
}
}
use of com.benmu.framework.manager.StorageManager in project WeexErosFramework by bmfe.
the class EventDeleteData method deleteDataSync.
public Object deleteDataSync(Context context, ArrayList<String> paramsList) {
String key = paramsList.get(0);
StorageManager storageManager = ManagerFactory.getManagerService(StorageManager.class);
boolean result = storageManager.deleteData(context, key);
return result ? JsPoster.getSuccess() : JsPoster.getFailed("删除" + key + "失败");
}
Aggregations