Search in sources :

Example 6 with StorageManager

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);
    }
}
Also used : StorageManager(com.benmu.framework.manager.StorageManager)

Example 7 with StorageManager

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();
}
Also used : StorageManager(com.benmu.framework.manager.StorageManager)

Example 8 with StorageManager

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);
    }
}
Also used : StorageManager(com.benmu.framework.manager.StorageManager)

Example 9 with StorageManager

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("存储失败");
}
Also used : StorageManager(com.benmu.framework.manager.StorageManager)

Aggregations

StorageManager (com.benmu.framework.manager.StorageManager)9 Intent (android.content.Intent)1 RouterModel (com.benmu.framework.model.RouterModel)1