SettingsFragment.java 文件源码

java
阅读 25 收藏 0 点赞 0 评论 0

项目:Fridge 作者:
@OnClick(R.id.text_measurement_type)
public void measurementTypeDialog(View view) {

    AlertDialogWrapper.Builder builder = new AlertDialogWrapper.Builder(getActivity());
    builder.setTitle(R.string.pick_measurement_type)
            .setItems(R.array.measurement_type_array, new DialogInterface.OnClickListener() {

                public void onClick(DialogInterface dialog, int which) {
                    // The 'which' argument contains the index position
                    // of the selected item
                    application.prefStore
                            .setInt(SharedPrefStore.Pref.SETTINGS_MEASUREMENT_TYPE, which);
                    textMeasurementTypeValue.setText(application.getResources()
                            .getStringArray(R.array.measurement_type_array)[which]);
                }
            });
    builder.create().show();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号