Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package android.support.v4.app;
  
  import android.util.Log;
  import android.view.View;
 
I'm in ur package. Stealing ur variables.
 
     private static final boolean DEBUG = false;
     private static final String TAG = "_ActionBarSherlockTrojanHorse";

    
Fragment interface for menu creation callback.
 
     public interface OnCreateOptionsMenuListener {
         public void onCreateOptionsMenu(Menu menuMenuInflater inflater);
     }
    
Fragment interface for menu preparation callback.
 
     public interface OnPrepareOptionsMenuListener {
         public void onPrepareOptionsMenu(Menu menu);
     }
    
Fragment interface for menu item selection callback.
 
     public interface OnOptionsItemSelectedListener {
       public boolean onOptionsItemSelected(MenuItem item);
     }
 
     private ArrayList<FragmentmCreatedMenus;
 
 
     ///////////////////////////////////////////////////////////////////////////
     // Sherlock menu handling
     ///////////////////////////////////////////////////////////////////////////
 
     @Override
     public boolean onCreatePanelMenu(int featureIdMenu menu) {
         if () Log.d("[onCreatePanelMenu] featureId: " + featureId + ", menu: " + menu);
 
         if (featureId == .) {
             boolean result = onCreateOptionsMenu(menu);
             if () Log.d("[onCreatePanelMenu] activity create result: " + result);
 
             MenuInflater inflater = getSupportMenuInflater();
             boolean show = false;
             ArrayList<FragmentnewMenus = null;
             if (. != null) {
                 for (int i = 0; i < ..size(); i++) {
                     Fragment f = ..get(i);
                     if (f != null && !f.mHidden && f.mHasMenu && f.mMenuVisible && f instanceof OnCreateOptionsMenuListener) {
                         show = true;
                         ((OnCreateOptionsMenuListener)f).onCreateOptionsMenu(menuinflater);
                         if (newMenus == null) {
                             newMenus = new ArrayList<Fragment>();
                         }
                         newMenus.add(f);
                     }
                 }
             }
 
             if ( != null) {
                 for (int i = 0; i < .size(); i++) {
                     Fragment f = .get(i);
                     if (newMenus == null || !newMenus.contains(f)) {
                         f.onDestroyOptionsMenu();
                     }
                 }
             }
 
              = newMenus;
 
             if () Log.d("[onCreatePanelMenu] fragments create result: " + show);
             result |= show;
 
             if () Log.d("[onCreatePanelMenu] returning " + result);
             return result;
         }
         return false;
     }
 
     @Override
     public boolean onPreparePanel(int featureIdView viewMenu menu) {
         if () Log.d("[onPreparePanel] featureId: " + featureId + ", view: " + view + " menu: " + menu);
 
         if (featureId == .) {
             boolean result = onPrepareOptionsMenu(menu);
             if () Log.d("[onPreparePanel] activity prepare result: " + result);
 
             boolean show = false;
             if (. != null) {
                 for (int i = 0; i < ..size(); i++) {
                     Fragment f = ..get(i);
                     if (f != null && !f.mHidden && f.mHasMenu && f.mMenuVisible && f instanceof OnPrepareOptionsMenuListener) {
                         show = true;
                         ((OnPrepareOptionsMenuListener)f).onPrepareOptionsMenu(menu);
                    }
                }
            }
            if () Log.d("[onPreparePanel] fragments prepare result: " + show);
            result |= show;
            result &= menu.hasVisibleItems();
            if () Log.d("[onPreparePanel] returning " + result);
            return result;
        }
        return false;
    }
    @Override
    public boolean onMenuItemSelected(int featureIdMenuItem item) {
        if () Log.d("[onMenuItemSelected] featureId: " + featureId + ", item: " + item);
        if (featureId == .) {
            if (onOptionsItemSelected(item)) {
                return true;
            }
            if (. != null) {
                for (int i = 0; i < ..size(); i++) {
                    Fragment f = ..get(i);
                    if (f != null && !f.mHidden && f.mHasMenu && f.mMenuVisible && f instanceof OnOptionsItemSelectedListener) {
                        if (((OnOptionsItemSelectedListener)f).onOptionsItemSelected(item)) {
                            return true;
                        }
                    }
                }
            }
        }
        return false;
    }
    public abstract boolean onCreateOptionsMenu(Menu menu);
    public abstract boolean onPrepareOptionsMenu(Menu menu);
    public abstract boolean onOptionsItemSelected(MenuItem item);
    public abstract MenuInflater getSupportMenuInflater();
New to GrepCode? Check out our FAQ X