本文整理汇总了Java中com.actionbarsherlock.app.SherlockPreferenceActivity类的典型用法代码示例。如果您正苦于以下问题:Java SherlockPreferenceActivity类的具体用法?Java SherlockPreferenceActivity怎么用?Java SherlockPreferenceActivity使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SherlockPreferenceActivity类属于com.actionbarsherlock.app包,在下文中一共展示了SherlockPreferenceActivity类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getContextForInflater
import com.actionbarsherlock.app.SherlockPreferenceActivity; //导入依赖的package包/类
/**
* @return Context which should be used for inflating the header layout
*/
public Context getContextForInflater(Activity activity) {
if (activity instanceof SherlockActivity) {
return ((SherlockActivity) activity).getSupportActionBar().getThemedContext();
} else if (activity instanceof SherlockListActivity) {
return ((SherlockListActivity) activity).getSupportActionBar().getThemedContext();
} else if (activity instanceof SherlockFragmentActivity) {
return ((SherlockFragmentActivity) activity).getSupportActionBar()
.getThemedContext();
} else if (activity instanceof SherlockExpandableListActivity) {
return ((SherlockExpandableListActivity) activity).getSupportActionBar()
.getThemedContext();
} else if (activity instanceof SherlockPreferenceActivity) {
return ((SherlockPreferenceActivity) activity).getSupportActionBar()
.getThemedContext();
}
return super.getContextForInflater(activity);
}
示例2: getContextForInflater
import com.actionbarsherlock.app.SherlockPreferenceActivity; //导入依赖的package包/类
/**
* @return Context which should be used for inflating the header layout
*/
public Context getContextForInflater(Activity activity) {
ActionBar ab = null;
if (activity instanceof SherlockActivity) {
ab = ((SherlockActivity) activity).getSupportActionBar();
} else if (activity instanceof SherlockListActivity) {
ab = ((SherlockListActivity) activity).getSupportActionBar();
} else if (activity instanceof SherlockFragmentActivity) {
ab = ((SherlockFragmentActivity) activity).getSupportActionBar();
} else if (activity instanceof SherlockExpandableListActivity) {
ab = ((SherlockExpandableListActivity) activity).getSupportActionBar();
} else if (activity instanceof SherlockPreferenceActivity) {
ab = ((SherlockPreferenceActivity) activity).getSupportActionBar();
}
Context context = null;
if (ab != null) {
context = ab.getThemedContext();
}
if (context == null) {
context = activity;
}
return context;
}
示例3: checkActivity
import com.actionbarsherlock.app.SherlockPreferenceActivity; //导入依赖的package包/类
void checkActivity() {
Context context = adapterView.getContext();
if (context instanceof ListActivity) {
throw new RuntimeException("ListView cannot belong to an activity which subclasses ListActivity");
}
if (context instanceof SherlockActivity || context instanceof SherlockFragmentActivity
|| context instanceof SherlockPreferenceActivity) {
return;
}
throw new RuntimeException("ListView must belong to an activity which subclasses SherlockActivity");
}
示例4: showActionBarwithBack
import com.actionbarsherlock.app.SherlockPreferenceActivity; //导入依赖的package包/类
/**
* Show the actionbar with backstack icon
*
* @param activity
* @param title
*/
public static void showActionBarwithBack(final SherlockPreferenceActivity activity,
final String title) {
if (activity == null) return;
setTitle(activity, title);
makeOverflowMenuShow(activity.getApplicationContext());
setActionBar(activity.getActionBar(), activity.getSupportActionBar(), R.drawable.ic_ab_up_compat);
}
示例5: actionBarSet
import com.actionbarsherlock.app.SherlockPreferenceActivity; //导入依赖的package包/类
public static synchronized void actionBarSet(SherlockPreferenceActivity activity) {
actionBarSet(activity, activity.getSupportActionBar());
}
示例6: setTitle
import com.actionbarsherlock.app.SherlockPreferenceActivity; //导入依赖的package包/类
public static void setTitle(final SherlockPreferenceActivity activity, final String title) {
if (activity == null || title == null) return;
activity.getSupportActionBar().setTitle(title);
activity.getSupportActionBar().setDisplayShowTitleEnabled(true);
}
示例7: showUpButton
import com.actionbarsherlock.app.SherlockPreferenceActivity; //导入依赖的package包/类
@Override
public void showUpButton() {
if (getActivity() instanceof SherlockActivity) {
((SherlockActivity) getActivity()).getSupportActionBar()
.setDisplayHomeAsUpEnabled(true);
} else if (getActivity() instanceof SherlockFragmentActivity) {
((SherlockFragmentActivity) getActivity()).getSupportActionBar()
.setDisplayHomeAsUpEnabled(true);
} else if (getActivity() instanceof SherlockExpandableListActivity) {
((SherlockExpandableListActivity) getActivity())
.getSupportActionBar().setDisplayHomeAsUpEnabled(true);
} else if (getActivity() instanceof SherlockListActivity) {
((SherlockListActivity) getActivity()).getSupportActionBar()
.setDisplayHomeAsUpEnabled(true);
} else if (getActivity() instanceof SherlockPreferenceActivity) {
((SherlockPreferenceActivity) getActivity()).getSupportActionBar()
.setDisplayHomeAsUpEnabled(true);
} else {
super.showUpButton();
}
}