|
今プリの開発で、 カスタムダイアログを表示 選択に応じて、ダイアログ内の文字を変化 という処理を行いたいのです。 以下のコードを、実機でデバッグしていたところ 問題が発生したので・・・(ry というメッセージが出ます。 ログなどで調べてみると、text.setText(〜)でエラーが 出ているようです。 ほかにも、ラジオボタンなどで試してみましたが代入ま ではいくのですがメソッドの実行でエラーが出ます。 いろいろ調べてみたのですがわからずじまいです。 ヒントだけでもいいのでお教えください。
▼メインコード抜粋 Dialog dialog = new Dialog(c_text); dialog.setContentView(R.layout.select_dialog); dialog.setTitle("Test Dialog"); dialog.show();
TextView text = (TextView)findViewById(R.id.textView1); text.setText("変更する内容");
▼xmlファイル レイアウト <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/ android" <TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="テスト" android:textAppearance="? android:attr/textAppearanceMedium" />
</LinearLayout>
|