Android Studioを使っています。
GridViewへ作成したAdapterをセットしたいのですが、以下でコンパイルエラーになります。
アドバイスを頂けませんか?
lang
1ArrayList<String> list = new ArrayList<String>(); 2 list.add("A"); 3 list.add("B"); 4 list.add("C"); 5 list.add("D"); 6 list.add("E"); 7 list.add("F"); 8ArrayAdapter<String> adapter2 = new ArrayAdapter<String>( 9this,android.R.layout.list,list);
lang
1<?xml version="1.0" encoding="utf-8"?> 2<TextView 3 xmlns:android="https://schemas.android.com/apk/res/android" 4 android:layout_width="match_parent" 5 android:layout_height="wrap_content"> 6</TextView>
lang
1<?xml version="1.0" encoding="utf-8"?> 2<LinearLayout 3 xmlns:android="http://schemas.android.com/apk/res/android" 4 android:orientation="vertical" 5 android:layout_width="match_parent" 6 android:layout_height="match_parent"> 7 8 <GridView 9 android:layout_width="match_parent" 10 android:layout_height="match_parent" 11 android:layout_weight="1" 12 android:id="@+id/gallery" 13 android:numColumns="2" 14 android:verticalSpacing="10dp" 15 android:horizontalSpacing="10dp" 16 android:background="#000"></GridView> 17</LinearLayout>
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。