本文整理匯總了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);
}