private void initPreferences() {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
((PreferenceGroup) findPreference(getString(R.string.pref_category_memory_resident))).removePreference(
findPreference(getString(R.string.pref_memory_resident_white_list)));
}
Observable.create(new ObservableOnSubscribe<Integer>() {
@Override
public void subscribe(ObservableEmitter<Integer> e) throws Exception {
e.onNext(mSettingRepository.getTargetStep());
}
}).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Consumer<Integer>() {
@Override
public void accept(Integer target) throws Exception {
findPreference(getString(R.string.pref_target_step)).setSummary(String.format(Locale.getDefault(),
"每日运动目标:%d步",
target));
}
});
}
SettingPreferenceFragment.java 文件源码
java
阅读 25
收藏 0
点赞 0
评论 0
项目:Run-With-You
作者:
评论列表
文章目录