aboutsummaryrefslogtreecommitdiffstats
path: root/libraries/ActionBarSherlock/src/com/actionbarsherlock/app/SherlockFragmentActivity.java
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/ActionBarSherlock/src/com/actionbarsherlock/app/SherlockFragmentActivity.java')
-rw-r--r--libraries/ActionBarSherlock/src/com/actionbarsherlock/app/SherlockFragmentActivity.java25
1 files changed, 15 insertions, 10 deletions
diff --git a/libraries/ActionBarSherlock/src/com/actionbarsherlock/app/SherlockFragmentActivity.java b/libraries/ActionBarSherlock/src/com/actionbarsherlock/app/SherlockFragmentActivity.java
index 3d092f033..e764c170b 100644
--- a/libraries/ActionBarSherlock/src/com/actionbarsherlock/app/SherlockFragmentActivity.java
+++ b/libraries/ActionBarSherlock/src/com/actionbarsherlock/app/SherlockFragmentActivity.java
@@ -19,7 +19,6 @@ import static com.actionbarsherlock.ActionBarSherlock.OnActionModeStartedListene
/** @see {@link android.support.v4.app.Watson} */
public class SherlockFragmentActivity extends Watson implements OnActionModeStartedListener, OnActionModeFinishedListener {
- private static final boolean DEBUG = false;
private static final String TAG = "SherlockFragmentActivity";
private ActionBarSherlock mSherlock;
@@ -139,33 +138,33 @@ public class SherlockFragmentActivity extends Watson implements OnActionModeStar
///////////////////////////////////////////////////////////////////////////
public MenuInflater getSupportMenuInflater() {
- if (DEBUG) Log.d(TAG, "[getSupportMenuInflater]");
+ if (ActionBarSherlock.DEBUG) Log.d(TAG, "[getSupportMenuInflater]");
return getSherlock().getMenuInflater();
}
public void invalidateOptionsMenu() {
- if (DEBUG) Log.d(TAG, "[invalidateOptionsMenu]");
+ if (ActionBarSherlock.DEBUG) Log.d(TAG, "[invalidateOptionsMenu]");
getSherlock().dispatchInvalidateOptionsMenu();
}
public void supportInvalidateOptionsMenu() {
- if (DEBUG) Log.d(TAG, "[supportInvalidateOptionsMenu]");
+ if (ActionBarSherlock.DEBUG) Log.d(TAG, "[supportInvalidateOptionsMenu]");
invalidateOptionsMenu();
}
@Override
public final boolean onCreatePanelMenu(int featureId, android.view.Menu menu) {
- if (DEBUG) Log.d(TAG, "[onCreatePanelMenu] featureId: " + featureId + ", menu: " + menu);
+ if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onCreatePanelMenu] featureId: " + featureId + ", menu: " + menu);
if (featureId == Window.FEATURE_OPTIONS_PANEL && !mIgnoreNativeCreate) {
mIgnoreNativeCreate = true;
boolean result = getSherlock().dispatchCreateOptionsMenu(menu);
mIgnoreNativeCreate = false;
- if (DEBUG) Log.d(TAG, "[onCreatePanelMenu] returning " + result);
+ if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onCreatePanelMenu] returning " + result);
return result;
}
return super.onCreatePanelMenu(featureId, menu);
@@ -178,14 +177,14 @@ public class SherlockFragmentActivity extends Watson implements OnActionModeStar
@Override
public final boolean onPreparePanel(int featureId, View view, android.view.Menu menu) {
- if (DEBUG) Log.d(TAG, "[onPreparePanel] featureId: " + featureId + ", view: " + view + ", menu: " + menu);
+ if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onPreparePanel] featureId: " + featureId + ", view: " + view + ", menu: " + menu);
if (featureId == Window.FEATURE_OPTIONS_PANEL && !mIgnoreNativePrepare) {
mIgnoreNativePrepare = true;
boolean result = getSherlock().dispatchPrepareOptionsMenu(menu);
mIgnoreNativePrepare = false;
- if (DEBUG) Log.d(TAG, "[onPreparePanel] returning " + result);
+ if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onPreparePanel] returning " + result);
return result;
}
return super.onPreparePanel(featureId, view, menu);
@@ -198,14 +197,14 @@ public class SherlockFragmentActivity extends Watson implements OnActionModeStar
@Override
public final boolean onMenuItemSelected(int featureId, android.view.MenuItem item) {
- if (DEBUG) Log.d(TAG, "[onMenuItemSelected] featureId: " + featureId + ", item: " + item);
+ if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onMenuItemSelected] featureId: " + featureId + ", item: " + item.getTitle());
if (featureId == Window.FEATURE_OPTIONS_PANEL && !mIgnoreNativeSelected) {
mIgnoreNativeSelected = true;
boolean result = getSherlock().dispatchOptionsItemSelected(item);
mIgnoreNativeSelected = false;
- if (DEBUG) Log.d(TAG, "[onMenuItemSelected] returning " + result);
+ if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onMenuItemSelected] returning " + result);
return result;
}
return super.onMenuItemSelected(featureId, item);
@@ -276,6 +275,12 @@ public class SherlockFragmentActivity extends Watson implements OnActionModeStar
getSherlock().requestFeature((int)featureId);
}
+ @Override
+ public View findViewById(int id) {
+ getSherlock().ensureActionBar();
+ return super.findViewById(id);
+ }
+
///////////////////////////////////////////////////////////////////////////
// Progress Indication