1

I am using a ListView populated from MySQL database, the number of listview items are determined by the rows returned from the database (changes when records are updated).

  • I do not want to use Fragments
  • Each ListView item has clickable buttons (the listView item itself will not be clickable, only the buttons on them will be)

I thought it would be something as simple as defining a horizontal orientation for the listview but it's not the case:

   <ListView
        android:id="@+id/listView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="horizontal"
         >
    </ListView>

This is what I would like to achieve: enter image description here

Ankita Shah
  • 1,866
  • 16
  • 31
user3560827
  • 632
  • 1
  • 5
  • 22
  • 2
    You should take a look at the `RecyclerView`. Which is the new way to organize list items. Plus, it's easy to show it horizontally. Look at http://stackoverflow.com/questions/28460300/how-to-build-a-horizontal-listview-with-recyclerview – megaturbo Nov 18 '16 at 13:27

1 Answers1

2

In this case Either you can Use HorizontalScrollView or ViewPager to achieve expected output.

Edited

As Thomas Suggested. You can Use RecyclerView also

Community
  • 1
  • 1
GreenROBO
  • 4,725
  • 4
  • 23
  • 43