On one, the ListView is displayed correctly, but not on the other.
There is exactly more than one String element in the array.
// ΠΠΎΠ»ΡΡΠ°Π΅ΠΌ ΠΌΠ°ΡΡΠΈΠ² Ρ ΠΊΠ°ΡΠ΅Π³ΠΎΡΠΈΡΠΌΠΈ: ArrayList<String> titleCategories = categories[0]; // ΠΠ°Ρ
ΠΎΠ΄ΠΈΠΌ ΡΠΏΠΈΡΠΎΠΊ, ΡΠΎΠ·Π΄Π°Π΅ΠΌ Π°Π΄Π°ΠΏΡΠ΅Ρ ΠΈ ΠΏΡΠΈΡΠ²Π°ΠΈΠ²Π°Π΅ΠΌ Π°Π΄Π°ΠΏΡΠ΅Ρ ΡΠΏΠΈΡΠΊΡ: ListView listCategories = (ListView) findViewById(R.id.listCategories); ArrayAdapter<String> mAdapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, titleCategories); listCategories.setAdapter(mAdapter); as a result, on the screen only the first element of the array. What am I doing wrong? I'll give you all the code for my xml markup:
<?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <LinearLayout android:orientation="vertical" android:layout_width="match_parent" android:layout_height="wrap_content"> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/button_download" android:id="@+id/button_download" android:onClick="onClickGetCategories"/> <ProgressBar style="?android:attr/progressBarStyleHorizontal" android:layout_width="match_parent" android:layout_height="100px" android:id="@+id/progressBar" android:layout_gravity="center_horizontal"/> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:textAppearance="?android:attr/textAppearanceMedium" android:text="..." android:id="@+id/titleCategory" android:layout_weight="0.16" /> <ListView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/listCategories" style="@style/TestListView" android:listSelector="@color/background_question_field" /> </LinearLayout> </ScrollView>