1
票
Accepted
フラグメントを用いたタブバーの作成中、setFragment() でエラーが出てきました。
Fragmentにはフレームワークが提供するクラスと、サポートライブラリが提供するクラスがあります(パッケージが違います)。
通常はサポートライブラリが提供するほうのFragmentを使うことが多いと思いますが、MainActivityではフレームワークのFragmentをimportしています。各フラグメントがどちらのクラスを使っているか確認してみてください。
1
票
Accepted
ラジオボタン型のアラートダイアログ内での選択項目をテキストビューに表示させたい
@Override
public void onClick(DialogInterface dialog, int which) {
MainActivity activity = new MainActivity();
((TextView)activity.findViewById(R.id.textView)).setText(items[which] + "が選択されました"...
Only top scored, non community-wiki answers of a minimum length are eligible
関連するタグ
android-fragments × 27android × 25
java × 5
android-layout × 4
android-studio × 3
android-activity × 2
kotlin × 1
http × 1
xml × 1
mvc × 1
android-volley × 1
android-listfragment × 1
android-lifecycle × 1