I am trying to get away from using 5 buttons when I would like to have one when pressed pops up a window that allows the user to select where they want to go.
Example: button “Country”
<Button
android:id="@+id/countrySelect"
android:layout_width="300px"
android:layout_height="wrap_content"
android:text="@string/backhome"
android:layout_x="8px"
android:layout_y="21px"
>
</Button>
and when pressed it would pop up a list of countrys to select from: Something like-
countrySelect.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view){
//POP UP SELECT MENU WHEN SELECTED START A NEW INTENT
Intent myIntent = new Intent(view.getContext(), ***SELECT MENU CONTROLS***.class);
startActivityForResult(myIntent, 0);
}
});
Sorry this probably is easy fix but I am not having much luck when I researched it.
You can add spinner in your layout.xml :
Now in Activity.java :
Now you can get gtghe selected value from the spinner by :
Good luck.