Context (Option) Menu: Android Programming

preview_player
Показать описание
Demonstration on how to create a context menu (options menu) on the Android phone.

Contents:
- Understanding the context menu.
- Adding items to a context menu.
- Responding to click events for the menu: launching another activity or changing text in a TextView.
- Adding an icon to the context menu.

Code:
@Override
public boolean onOptionsItemSelected(MenuItem item) {

// Dump out the event:

break;

}

return true;
}
Рекомендации по теме
Комментарии
Автор

Your tutorials are fantastic. You're clear, concise, and fast.

trudyandgeorge
Автор

I am not sure why you call this tutorial Context Menu because Context menus and Options menus are two totally different concepts in Android.  This tutorial is simply working with the Options Menu (which supports XML layouts etc...)  The Context menu is usually done in code, and does NOT support icons (unless you use custom libraries or use a hack by having a Dialog Window act like a Context menu).

apristinemadani
Автор

Very interesting, very well explained! Thank you very much!

dhrPKaldewaij
Автор

awesome tutorial for the beginner thank you for share 

rpitpatel
Автор

why i have follow ur step and i cnt get to go to other screen or activity after i click on other menu?

rupinsonsoon
Автор

You are genius.  Thank you very much for very details video.  I now know how to add images to the  

dantehunter
Автор

that's so great tutorial, ....it was so helpfull for me, ....thanks so much, ..
but i have practiced and tried for that tutorial, ....i have a little problem where, ..my icon couldn't appear on menu, ...

How can i fix it?? please suggest me, ..

Thanks

AminVincent
Автор

A Context menu is a menu that pop when longClicked some object bro

tarf
Автор

This is the old context menu before android 4.0

MichaelMillerGR
Автор

this's not Context Menu... it's just a Menu !

thuanngo
join shbcf.ru