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

How to populate database records in spinner

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:
public class UpdateActivity extends AppCompatActivity {
        Spinner spinner;
        ArrayAdapter adapter1;
    String url1="http://192.168.1.6/student/web/studentrecords";
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate ( savedInstanceState );
        setContentView ( R.layout.activity_update );
        spinner = (Spinner) findViewById ( R.id.spinner1 );
    }
}
 
Back
Top Bottom