Menu in Android | Android Tutorial for Beginners

preview_player
Показать описание
This video will tell how to set menu items in android activity and how to perform action on that item.

We will learn about onCreateOptionsMenu() and onOptionsItemSelected() methods of menu.

Menus are like options given to the user.User can select any menu items form the menu.

Follow on Facebook:

Subscribe to our other channel:
Telusko Hindi :

Subscribe to the channel and learn Programming in easy way.

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

how do i do this with fragments ? stackoverflow answers did not help.. just cant get them to work

oliverilmjarv
Автор

Is this the only way to create a menu? I was looking for a more standard group of buttons to switch between activities.

darkman
Автор

Hi sir I have a doubt on bottom navigation bar when tab is unselected it displays the text properly.when it is selected text half.can u please clarify my doubt?

prasannakodela
Автор

Sir how to create Menu I resource directory..¿

antareepdas
Автор

Sir is this also the another way to create menu?

raghavbhardwaj
Автор

plz make videos on network discovery and wifi p2p

SHIVAMPANDEYSJTG
Автор

Sir, please make a video on making a app browser please sir.

princenain
Автор

There are two buttons 1. Patient and 2. on clicking each of these popup menu then i added this onOptionsItemselected but it doesn't work at nothing happens when i click the buttons under popup menu

here the java code...


public void onClickingPatient(View view){
PopupMenu popup = new PopupMenu(this, view);
MenuInflater inflater = popup.getMenuInflater();
inflater.inflate(R.menu.main_menu, popup.getMenu());
popup.show();
}

public void onClickingDoctor(View view){
PopupMenu popup = new PopupMenu(this, view);
MenuInflater inflater = popup.getMenuInflater();
inflater.inflate(R.menu.doctor_menu, popup.getMenu());
popup.show();
}

@Override
public boolean item){
switch(item.getItemId()) {
case R.id.loginAsPatient:
View viewCurrent = LayoutInflater.from(MainActivity.this).inflate(R.layout.activity_login_details, null);
AlertDialog.Builder builder = new
builder.setMessage("Login Here");
builder.setView(viewCurrent);
break;
case R.id.loginAsDoctor:
break;
}
return false;
}

SanjeevSingh-mctl
Автор

getmenuinflater().inflate(r.menu.main_menu, menu) menu cannot be resolved in android studio

mikkilinenipavankumar
Автор

i didnt have that menu folder
how to create that

harshrai
join shbcf.ru