teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

1

情報追加

2017/06/03 03:36

投稿

s.k
s.k

スコア423

answer CHANGED
@@ -20,8 +20,39 @@
20
20
 
21
21
  setListAdapterMethodを新しく作り解決できました。
22
22
 
23
+ Before
24
+ ```Java
25
+ setListAdapter(new ArrayAdapter<String>(getActivity(),
26
+ android.R.layout.simple_list_item_activated_1,
27
+ lists));
28
+ getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);
29
+ getListView().setBackgroundColor(Color.LTGRAY);
30
+ if (isTablet(getActivity())) showDetails(0);
31
+ ```
23
32
 
24
33
 
34
+ After
35
+ ```Java
36
+
37
+ public void setListAdapterMethod(List<String> lists){
38
+ System.out.println(lists);
39
+ setListAdapter(new ArrayAdapter<String>(getActivity(),
40
+ android.R.layout.simple_list_item_activated_1,
41
+ lists));
42
+ getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);
43
+ getListView().setBackgroundColor(Color.LTGRAY);
44
+ if (isTablet(getActivity())) showDetails(0);
45
+ }
46
+ ```
47
+
48
+
49
+
50
+
51
+
52
+
53
+ ★以下全コード★
54
+
55
+
25
56
  Present.java
26
57
  ```Java
27
58
  public class Present extends Activity {