I have two buttons in my actionbar namely: logout and edit profile. When I clicked edit profile, I want to show drop down menu but I don't know how. Please help. Thanks in advance!
public boolean onOptionsItemSelected(MenuItem item)
{
switch(item.getItemId())
{
case R.id.action_logout:
AlertDialog.Builder builder=new AlertDialog.Builder(AdminHome.this);
builder.setMessage("Are you sure you want to logout?")
.setPositiveButton("Logout", new DialogInterface.OnClickListener()
{
@Override
public void onClick(DialogInterface dialog, int which)
{
new Logs().execute();
finish();
Intent in=new Intent(AdminHome.this, MainActivity.class);
startActivity(in);
}
})
.setNegativeButton("Cancel", new DialogInterface.OnClickListener()
{
@Override
public void onClick(DialogInterface dialog, int which)
{
}
})
.show();
return true;
case R.id.edituser:
//WHAT TO PUT IN HERE
return true;
}
return super.onOptionsItemSelected(item);
}