Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
カスタム ダイアログでチェックされたラジオボタンを取得するにはどうすればよいでしょうか。2 つのラジオボタンを含むカスタム ダイアログがありますが、ラジオボタンをクリックするたびにヌル ポインター例外が発生します。
RadioButton rb = (RadioButton)dialog.findViewById(R.id.radiobutton);代わりにラジオボタンを使用する初期化中RadioButton rb = (RadioButton)findViewById(R.id.radiobutton);
RadioButton rb = (RadioButton)dialog.findViewById(R.id.radiobutton);
RadioButton rb = (RadioButton)findViewById(R.id.radiobutton);