0

私の機能の 1 つは、ユーザーが月と年を選択する必要があるため、最初に添付された画像 (d/m/y) をポップアップ表示する方法は次のとおりです。

final Calendar c = Calendar.getInstance();

                        int year = c.get(Calendar.YEAR);
                        int month = c.get(Calendar.MONTH);
                        int day = c.get(Calendar.DAY_OF_MONTH);

                        DatePickerDialog dp = new DatePickerDialog(getActivity(), android.R.style.Theme_Holo_Light_Dialog_MinWidth,
                                new DatePickerDialog.OnDateSetListener() {

                                    @Override
                                    public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
                                        //Check if selected month/year is in future of today. 
                                    }

                                }, year, month, day);

                        dp.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
                        dp.setTitle("Set Monthly Overview");
                        dp.show(); 

ここに画像の説明を入力

ただし、日付は必要ありません。ユーザーがそれを選択できないようにするにはどうすればよいですか?

私が達成したいのは、最良のシナリオで次の画像のようなものです。

ここに画像の説明を入力

4

1 に答える 1