获取activty title bar:
TextView actionTitle = (TextView) findViewById(com.android.internal.R.id.action_bar_title);
View actionTitle = getWindow().getDecorView().findViewById(getResources().getIdentifier("android:id/action_bar_title", null, null));
12小时格式时,获取上午还是下午:
String smPmStr = DateUtils.getAMPMString(Calendar.getInstance().get(Calendar.AM_PM));//上午(下午)
12小时时间格式时,只显示时间,不显示“上午“这样的字符串:
将系统当前事件,转化为所需格式:
如果为今天,则显示时间,如果不是今天则显示日期
在源码短信息模块中MessageUtils.java中有这样一个函数,与上面的功能相同:
软键盘显示消失及取反
或者
getWindow().setSoftInputMode(
WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
或者