Jun 29
android getVersionName
————
public String getVersionName(Context context, Class cls) { try { ComponentName comp = new ComponentName(context, cls); PackageInfo pinfo = context.getPackageManager().getPackageInfo(comp.getPackageName(), 0); return pinfo.versionName; } catch (android.content.pm.PackageManager.NameNotFoundException e) { return null; }}
Tagged with: Android
Jun 25
<TextView android:text="蝚砌銵\n蝚砌銵\n蝚砌銵"
android:id="@+id/newline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:textColor="#FFF" />
嚗瘜冽瘀汞clipse鋆∠layout閬賣臭憿舐內箸嚗閬曉蚩mulator銝箔
Tagged with: Android • StudyNote
Jun 24
瘨斗憿
requestWindowFeature(Window.FEATURE_NO_TITLE);
瘨斤
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow() 踹 Window object
setFlag() 蝯虫 Window 撅祆
WindowManager.LayoutParams.FLAG_FULLSCREEN銵函內箄身摰刻W
蝔撘蝣潭曉矣nCreate敺嚗setContentView
蝭靘蝣潘
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.info);
}
ref1: 望孵憸刻: Android 函撘刻W雿瘜
ref2: Android hidden title bar comes back – Stack Overflow
Tagged with: Android
啣