I would like to have pop up menu, when I click on the 3 dots area in a ListView
row.
You can use ImageView
to display image with 3 dots.
There are two ways for popupmenu
a) Use some layouts and make them visible/gone
b) Use PopupWindow
.
here is sample code for PopupWindow
PopupWindow popupWindow = new PopupWindow(context);
View popUpView = View.inflate(activity, linearlayout, null);
popUpView.setBackgroundColor(Color.TRANSPARENT);
mpopup.setContentView(popUpView);
mpopup.setHeight(LayoutParams.WRAP_CONTENT);
mpopup.setWidth(LayoutParams.WRAP_CONTENT);
mpopup.setFocusable(true);
mpopup.setBackgroundDrawable(activity.getResources().getDrawable(R.drawable.transperent));
mpopup.setOutsideTouchable(true);
mpopup.setAnimationStyle(R.anim.slide_out_up);
mpopup.showAtLocation(popUpView, Gravity.TOP, activity.getResources()
.getInteger(R.integer.log_out_popup_x), activity.getResources()
.getInteger(R.integer.log_out_popup_y));