I'm trying to customize popup menu but failed to customize. I had tried many suggestions and solution but no luck to achieve this.
Please check and suggest me where I'm wrong...
I want to Create Popmenu like this:
And I've tried these codes:
public PopupWindow popupDisplay() {
final PopupWindow popupWindow = new PopupWindow(context);
// inflate your layout or dynamically add view
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View view = inflater.inflate(R.layout.hs_popup_item, null);
popupWindow.setFocusable(true);
popupWindow.setWidth(WindowManager.LayoutParams.WRAP_CONTENT);
popupWindow.setHeight(WindowManager.LayoutParams.WRAP_CONTENT);
popupWindow.setContentView(view);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
popupWindow.setElevation(4);
}
popupWindow.setClippingEnabled(true);
return popupWindow;
}
Please guide me how I can add sub Title(descriptions) in the popup menu.