In my activity_main.xml file i have one spinner and one button.
Where spinner values are coming from mysql database.
I just only want the position of selected value of spinner after clicking on Button.
MainActivity.java file -
button.setOnClickListener(this);
@Override
public void onClick(View v) {
if(v==button)
{
String Pos= spinner.getSelectedItem().toString();
Toast.makeText(getApplicationContext(),Pos,Toast.LENGTH_SHORT).show();
}
}
But here i only get the selected Item not position.