Package android.view

Examples of android.view.MenuItem


  public boolean onCreateOptionsMenu(Menu menu)
  {
   
      super.onCreateOptionsMenu(menu);
     
      MenuItem settings = menu.add(Menu.NONE, ID_SETTINGS, Menu.NONE, "Settings");
      settings.setIcon(android.R.drawable.ic_menu_preferences);
      settings.setOnMenuItemClickListener(new OnMenuItemClickListener()
      {

      public boolean onMenuItemClick(MenuItem item)
      {
        Intent i = new Intent();
        i.setClass(getApplicationContext(), EditPreferencesActivity.class);
        MainActivity.this.startActivity(i);
        return true;
      }
       
      });
     
      MenuItem about = menu.add(Menu.NONE, Menu.NONE, Menu.NONE, "About");
      about.setIcon(android.R.drawable.ic_menu_info_details);
      about.setOnMenuItemClickListener(new OnMenuItemClickListener()
      {

      public boolean onMenuItemClick(MenuItem item)
      {
        MainActivity.this.startActivity(AboutActivity.INTENT);
View Full Code Here


      Method m = sm.getClass().getMethod("getSearchableInfo",
          android.content.ComponentName.class);
      Object si = m.invoke(sm, activity.getComponentName());

      MenuItem item = menu.findItem(R.id.list_search);
      m = item.getClass().getMethod("getActionView");
      View widget = (View) m.invoke(item);

      m = widget.getClass().getMethod("setSearchableInfo", si.getClass());
      m.invoke(widget, si);
View Full Code Here

TOP

Related Classes of android.view.MenuItem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.