Pank
Pank

Reputation: 14268

Need help in list view in android

I am new bea to android and want to open a list view/menu (see image:2) after click on image/button (see image:1). I am not sure whether it is list or dialog or some other component. Please help me out.

enter image description here

enter image description here

Upvotes: 3

Views: 110

Answers (3)

Paresh Mayani
Paresh Mayani

Reputation: 128428

That is Drop-Down navigation for the ActionBar, you can check official documentation for the same: Adding Drop-down Navigation.

ActionBar actionBar = getActionBar();
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
actionBar.setListNavigationCallbacks(mSpinnerAdapter, mNavigationCallback);
// It takes your SpinnerAdapter and ActionBar.OnNavigationListener.

Check Examples:

  1. Adding Drop down navigation to action bar in Android
  2. Adapter part 1 on Styling Android

Update:

To provide app compatibility for the lower Android version, I would suggest you to include actionbarsherlock library, once you will download it, you will be able to access many samples too.

Upvotes: 1

Dhaval Parmar
Dhaval Parmar

Reputation: 18978

its ActionBar.NAVIGATION_MODE_LIST

check this link Because it Working for All Android OS Version

in that many sample available for more details check this artical

enter image description here

Upvotes: 1

Amit
Amit

Reputation: 1385

It is a Spinner in Android. Please check below link

http://developer.android.com/guide/topics/ui/controls/spinner.html

If you want to implement behavior like GMail, then you need to override getView method of your Spinner Adapter

Upvotes: 0

Related Questions