use of com.benmu.framework.manager.StorageManager in project WeexErosFramework by bmfe.
the class EventGetData method getData.
public void getData(Context context, ArrayList<String> paramsList, JSCallback jscallback) {
String key = paramsList.get(0);
StorageManager storageManager = ManagerFactory.getManagerService(StorageManager.class);
String result = storageManager.getData(context, key);
if (TextUtils.isEmpty(result)) {
JsPoster.postFailed(jscallback);
} else {
JsPoster.postSuccess(result, jscallback);
}
}
use of com.benmu.framework.manager.StorageManager in project WeexErosFramework by bmfe.
the class EventRemoveData method removeDataSync.
public Object removeDataSync(Context context) {
StorageManager storageManager = ManagerFactory.getManagerService(StorageManager.class);
boolean result = storageManager.removeData(context);
return result ? JsPoster.getSuccess(null) : JsPoster.getFailed();
}
use of com.benmu.framework.manager.StorageManager in project WeexErosFramework by bmfe.
the class EventSetData method setData.
public void setData(Context context, ArrayList<String> paramsList, JSCallback jscallback) {
StorageManager storageManager = ManagerFactory.getManagerService(StorageManager.class);
String key = paramsList.get(0);
String value = paramsList.get(1);
boolean result = storageManager.setData(context, key, value);
if (result) {
JsPoster.postSuccess(null, jscallback);
} else {
JsPoster.postFailed("存储失败", jscallback);
}
}
use of com.benmu.framework.manager.StorageManager in project WeexErosFramework by bmfe.
the class EventSetData method setDataSync.
public Object setDataSync(Context context, ArrayList<String> paramsList) {
StorageManager storageManager = ManagerFactory.getManagerService(StorageManager.class);
String key = paramsList.get(0);
String value = paramsList.get(1);
boolean result = storageManager.setData(context, key, value);
return result ? JsPoster.getSuccess() : JsPoster.getFailed("存储失败");
}
Aggregations