In the game menu 2 of the ListView . From them you need to choose the model and game mode. I place the whole screen inside the ScrollView so that when the orientation of the row of the list changes, they do not leave the screen. But ScrollView turns both ListView into strings. How to fix?
In the xml screen code, all parameters are match_parent , except for the root layout and 2 texts.
<RelativeLayout ...(корневой)> <ScrollView> <HorizontalScrollView> <RelativeLayout> <TextView ... /> <ListView ... /> <TextView ... /> <ListView ... /> <Button ... /> </RelativeLayout> </HorizontalScrollView> </ScrollView> </RelativeLayout> Code Lists:
String[] list = {"Animals", "Dishes", "Figures", "Flags", "Fruits", "Football players", "Musical instruments", "Numbers", "Tools", "Transportation"}; String[] list2 = {"Small", "Medium", "Big"}; ListView listView, listView2; TextView textView, textView2; Button button; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_game); ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, R.layout.mylistlayout, list); ArrayAdapter<String> adapter2 = new ArrayAdapter<String>(this, R.layout.mylistlayout, list2); listView = (ListView) findViewById(R.id.listView0); listView2 = (ListView) findViewById(R.id.listView2); listView.setAdapter(adapter); listView.setChoiceMode(ListView.CHOICE_MODE_SINGLE); listView2.setAdapter(adapter2); listView2.setChoiceMode(ListView.CHOICE_MODE_SINGLE); And here is the picture:
