Creating ArrayAdapter using xml resource and retrieving “id” or “value” fields using spinner
- 阅读更多 关于 Creating ArrayAdapter using xml resource and retrieving “id” or “value” fields using spinner
问题 I am trying to create a spinner, the values of which I am populating from a resource xml, using ArrayAdapter. I also want to give the resource items some "id" or "value". How can i retrieve these values inside the onItemSelected() callback ? Here is the Java code. package com.waus.waus; import android.os.Bundle; import android.app.Activity; import android.view.Menu; import android.view.View; import android.widget.AdapterView; import android.widget.AdapterView.OnItemSelectedListener; import