Advertisement
Guest User

Untitled

a guest
Apr 1st, 2011
939
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None
  1. //Create menu
  2. var activity = Ti.Android.currentActivity;
  3. activity.onCreateOptionsMenu = function(e) {
  4.  
  5. var menu = e.menu;
  6.  
  7. //Toggel Cancel Button
  8. var menuItem = menu.add({ title: "Toggle Cancel" });
  9. menuItem.addEventListener("click", function() {
  10. search.showCancel = (search.showCancel==true)?false:true;
  11. });
  12. //History
  13. var menuItem = menu.add({ title: "History" });
  14. menuItem.addEventListener("click", function() {
  15. //TODO
  16. });
  17. //Back
  18. var menuItem = menu.add({title: "Back" });
  19. menuItem.addEventListener("click", function() {
  20. Ti.Android.currentActivity.finish();
  21. });
  22. };
Advertisement
RAW Paste Data Copied
Advertisement