1. Are you ready for the Galaxy S20? Here is everything we know so far!

How to populate database records in spinner

Discussion in 'Android Development' started by Prashant Sontale, Aug 31, 2019.

  1. Prashant Sontale

    Thread Starter

    I am using web service. I have a student application. The API returns JSON array containing student Id, FirstName, LastName and Class. In Update section I want that In spinner Students FirstName and LastName must be displayed. When the user selects any student then user should be able to update the fields as required. So how should I display database records in spinner

    Code (Text):
    1. public class UpdateActivity extends AppCompatActivity {
    2.         Spinner spinner;
    3.         ArrayAdapter adapter1;
    4.     String url1="";
    5.     @Override
    6.     protected void onCreate(Bundle savedInstanceState) {
    7.         super.onCreate ( savedInstanceState );
    8.         setContentView ( R.layout.activity_update );
    9.         spinner = (Spinner) findViewById ( R.id.spinner1 );
    10.     }
    11. }

  2. ocnbrze

    ocnbrze DON'T PANIC!!!!!!!!!

    not sure what this is....this looks like a development question.....yes? for android??
  3. Prashant Sontale

    Thread Starter

    Yes. I want to populate spinner with records from database.

Share This Page