Advertisement
Guest User

Untitled

a guest
Aug 2nd, 2015
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. @Override
  2. public void onClick(View v) {
  3. if(v.getId() == R.id.action_reading) {
  4. PopupMenu popup = new PopupMenu(context, v);
  5. popup.setOnMenuItemClickListener(new OnMenuItemClickListener() {
  6. @Override
  7. public boolean onMenuItemClick(MenuItem arg0) {
  8. System.out.println("------ click menu");
  9. return false;
  10. }
  11. });
  12. popup.getMenuInflater().inflate(R.menu.action_reading_menu, popup.getMenu());
  13. popup.show();
  14. }
  15. }
  16.  
  17. <Button android:id="@+id/action_reading"
  18. android:layout_width="30dp"
  19. android:layout_height="35dp"
  20. android:layout_alignParentRight="true"
  21. android:layout_alignParentTop="true"/>
  22.  
  23. <?xml version="1.0" encoding="utf-8"?>
  24. <menu xmlns:android="http://schemas.android.com/apk/res/android" >
  25. <item android:id="@+id/delete_item_reading"
  26. android:title="Delete"
  27. android:visible="true"></item>
  28. </menu>
  29.  
  30. java.lang.RuntimeException: Binary XML file line #17: You must supply a layout_height attribute.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement