Click here to Skip to main content
15,893,663 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to retrieve information from database and display it in textview & spinner? Below is my codes for my main activity

C#
private void displayCurrentNearableInfo() {

        Desc = (TextView) findViewById(R.id.textview1);   //for description
        // Get reference of SpinnerView from layout/nearable_demo.xml
        spinnerDropDown = (Spinner) findViewById(R.id.spinner1);  //For size available
        spinnerDropDown2 = (Spinner) findViewById(R.id.spinner2);//for colours available
        COO = (TextView) findViewById(R.id.textview2);//for country of origin
        SM = (TextView) findViewById(R.id.textview3); //for shoe model
        Price = (TextView) findViewById(R.id.textview4); //for price

        stickerdb = new Database_sticker(this);
        dbRow = stickerdb.getResult(currentNearable.identifier);
        dbRow.getDesc();
        dbRow.getSa();
        dbRow.getCa();
        dbRow.getCoo();
        dbRow.getSm();
        dbRow.getPrice();
    }
Posted

1 solution

In this following tutorial it is explained how to populate spinner data from SQLite Database.
Android Populating Spinner data from SQLite Database[^]

And much for result for you: Google[^] :)
I go the very first link as a solution for your query, you too should use Google[^] sometimes.

-KR
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900