SHARE
TWEET

Untitled

a guest Apr 1st, 2011 831 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. };
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top