android.content.ContextWrapper#MODE_MULTI_PROCESS源码实例Demo

下面列出了android.content.ContextWrapper#MODE_MULTI_PROCESS 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: PS4-Payload-Sender-Android   文件: Prefs.java
/**
 * Set the mode of the sharedpreference instance.
 *
 * @param mode Operating mode.  Use 0 or {@link Context#MODE_PRIVATE} for the
 *             default operation, {@link Context#MODE_WORLD_READABLE}
 * @return the {@link com.pixplicity.easyprefs.library.Prefs.Builder} object.
 * @see Context#getSharedPreferences
 */
public Builder setMode(final int mode) {
    if (mode == ContextWrapper.MODE_PRIVATE || mode == ContextWrapper.MODE_WORLD_READABLE || mode == ContextWrapper.MODE_WORLD_WRITEABLE || mode == ContextWrapper.MODE_MULTI_PROCESS) {
        mMode = mode;
    } else {
        throw new RuntimeException("The mode in the sharedpreference can only be set too ContextWrapper.MODE_PRIVATE, ContextWrapper.MODE_WORLD_READABLE, ContextWrapper.MODE_WORLD_WRITEABLE or ContextWrapper.MODE_MULTI_PROCESS");
    }

    return this;
}
 
源代码2 项目: EasyPrefs   文件: Prefs.java
/**
 * Set the mode of the SharedPreference instance.
 *
 * @param mode Operating mode.  Use 0 or {@link Context#MODE_PRIVATE} for the
 *             default operation, {@link Context#MODE_WORLD_READABLE}
 * @return the {@link com.pixplicity.easyprefs.library.Prefs.Builder} object.
 * @see Context#getSharedPreferences
 */
@SuppressLint({"WorldReadableFiles", "WorldWriteableFiles"})
public Builder setMode(final int mode) {
    if (mode == ContextWrapper.MODE_PRIVATE || mode == ContextWrapper.MODE_WORLD_READABLE || mode == ContextWrapper.MODE_WORLD_WRITEABLE || mode == ContextWrapper.MODE_MULTI_PROCESS) {
        mMode = mode;
    } else {
        throw new RuntimeException("The mode in the SharedPreference can only be set too ContextWrapper.MODE_PRIVATE, ContextWrapper.MODE_WORLD_READABLE, ContextWrapper.MODE_WORLD_WRITEABLE or ContextWrapper.MODE_MULTI_PROCESS");
    }

    return this;
}