Search code examples
androiddatabasetabular

Android tabluar data from database


I want to show all the data from the database in a View. addview to the layout is a good idea. But as I don't know the no. of data, I cann't create required no. of textview, and i cann't add a single textview multiple number of time. How can I solve this problem?


Solution

  • But as I don't know the no. of data, I cann't create required no. of textview, and i cann't add a single textview multiple number of time.

    You don't need to create TextView multiple times, it would lead to more complex application. Rather I would suggest you shold create a simple or custom ListView using simple or custom ArrayAdapter or BaseAdapter or CursorAdapteraccordingly your needs.

    Refer this: Getting Stored Data from my Database into ListView