• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Populate ListView with two tables in Android

faran100

Lurker
May 4, 2020
1
0
hello,
I have two tables. Arabic and urdu. I want to display select query to listview Line by line (arabic/Urdu).
I Have no issue to display one query to listview but I am failed to multi select from 2 table and populate Listview.

Code:
(Private feedback for you)

I have two tables. Arabic and urdu. I want to list Line by line (arabic/Urdu) for display Arabic i have no issue

Cursor cursor = myDbHelper.Surahbyid(Value);
        // The desired columns to be bound
        String[] columns = new String[]{
                myDbHelper.KEY_AYA,
                myDbHelper.KEY_TEXT,

        };
        int[] to = new int[]{
                R.id.id,
                R.id.aya,


        };

        // create the adapter using the cursor pointing to the desired data
        //as well as the layout information
        dataAdapter = new SimpleCursorAdapter(
                this, R.layout.surah,
                cursor,
                columns,
                to,
                0);


        listView.setAdapter(dataAdapter);
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones