本文整理汇总了Java中android.app.ActionBar.setSubtitle方法的典型用法代码示例。如果您正苦于以下问题:Java ActionBar.setSubtitle方法的具体用法?Java ActionBar.setSubtitle怎么用?Java ActionBar.setSubtitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.app.ActionBar
的用法示例。
在下文中一共展示了ActionBar.setSubtitle方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import android.app.ActionBar; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
SettingsTheme.apply(this);
String appVersion = BuildConfig.VERSION_NAME;
ActionBar mActionBar = getActionBar();
if (mActionBar != null) {
mActionBar.setSubtitle(appVersion);
mActionBar.setDisplayHomeAsUpEnabled(true);
}
// Display the fragment as the main content.
getFragmentManager().beginTransaction()
.replace(android.R.id.content, new LauncherSettingsFragment())
.commit();
}
示例2: setActionBarDescription
import android.app.ActionBar; //导入方法依赖的package包/类
public static SetIndicatorInfo setActionBarDescription(SetIndicatorInfo info, Activity activity,
int contentDescRes) {
if (info == null) {
info = new SetIndicatorInfo(activity);
}
if (info.setHomeAsUpIndicator != null) {
try {
final ActionBar actionBar = activity.getActionBar();
info.setHomeActionContentDescription.invoke(actionBar, contentDescRes);
if (Build.VERSION.SDK_INT <= 19) {
// For API 19 and earlier, we need to manually force the
// action bar to generate a new content description.
actionBar.setSubtitle(actionBar.getSubtitle());
}
} catch (Exception e) {
Log.w(TAG, "Couldn't set content description via JB-MR2 API", e);
}
}
return info;
}
示例3: setActionBarDescription
import android.app.ActionBar; //导入方法依赖的package包/类
public static SetIndicatorInfo setActionBarDescription(SetIndicatorInfo info, Activity activity, int contentDescRes) {
if (info == null) {
info = new SetIndicatorInfo(activity);
}
if (info.setHomeAsUpIndicator != null) {
try {
ActionBar actionBar = activity.getActionBar();
info.setHomeActionContentDescription.invoke(actionBar, new Object[]{Integer.valueOf(contentDescRes)});
if (VERSION.SDK_INT <= 19) {
actionBar.setSubtitle(actionBar.getSubtitle());
}
} catch (Exception e) {
Log.w(TAG, "Couldn't set content description via JB-MR2 API", e);
}
}
return info;
}
示例4: setActionBarDescription
import android.app.ActionBar; //导入方法依赖的package包/类
public static Object setActionBarDescription(Object info, Activity activity, int contentDescRes) {
SetIndicatorInfo setIndicatorInfo;
if (info == null) {
setIndicatorInfo = new SetIndicatorInfo(activity);
}
SetIndicatorInfo sii = setIndicatorInfo;
if (sii.setHomeAsUpIndicator != null) {
try {
ActionBar actionBar = activity.getActionBar();
sii.setHomeActionContentDescription.invoke(actionBar, new Object[]{Integer.valueOf(contentDescRes)});
if (VERSION.SDK_INT <= 19) {
actionBar.setSubtitle(actionBar.getSubtitle());
}
} catch (Exception e) {
Log.w(TAG, "Couldn't set content description via JB-MR2 API", e);
}
}
return setIndicatorInfo;
}
示例5: setStatus
import android.app.ActionBar; //导入方法依赖的package包/类
/**
* Updates the status on the action bar.
*
* @param resId a string resource ID
*/
private void setStatus(int resId) {
FragmentActivity activity = getActivity();
if (null == activity) {
return;
}
final ActionBar actionBar = activity.getActionBar();
if (null == actionBar) {
return;
}
actionBar.setSubtitle(resId);
}
示例6: setStatus
import android.app.ActionBar; //导入方法依赖的package包/类
private void setStatus(int resId) {
FragmentActivity activity = getActivity();
if (null == activity) {
return;
}
final ActionBar actionBar = activity.getActionBar();
if (null == actionBar) {
return;
}
actionBar.setSubtitle(resId);
}
示例7: setStatus
import android.app.ActionBar; //导入方法依赖的package包/类
private final void setStatus(int resId) {
final ActionBar actionBar = getActionBar();
actionBar.setSubtitle(resId);
}