Spinner in Toolbar Example in Android
Step: 1 ====== SpinToolbarActivity.java package com . pratap . cardviews1 ; import java.util.ArrayList ; import android.os.Bundle ; import android.support.v7.app.ActionBarActivity ; import android.support.v7.widget.Toolbar ; import android.view.Menu ; import android.view.MenuItem ; import android.view.View ; import android.widget.AdapterView ; import android.widget.AdapterView.OnItemSelectedListener ; import android.widget.Spinner ; import android.widget.Toast ; public class SpinToolbarActivity extends AppCompatActivity { private Toolbar toolbar ; private Spinner spinner_nav ; @Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ); setContentView ( R . layout . spintoolbaractivity ); toolbar = ( Toolbar ) findViewById ( R . id . toolbar ); spinner_nav = ( Spinner ) findViewById ( R . id . spinner_nav ); if ( toolbar != null ) { setSupportActionBar ( toolbar ); getSupportActionBar (). setD...