android开发 日常常用整理

1、全屏:requestWindowFeature(Window.FEATURE_NO_TITLE);

2、竖屏:setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);// 竖屏

3、/mnt/sdcard/:Environment.getExternalStorageState()

4、隐藏键盘:getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);

5、自定义布局背景:android:background="@drawable/shape"

    shape.xml:
    <?xml version="1.0" encoding="utf-8"?>
    <shape xmlns:android="http://schemas.android.com/apk/res/android">
        <!--布局背景色-->
        <solid android:color="#ffffcc" />
        <!--布局边角弧度-->
        <corners android:radius="8px" />
        <!--布局边框颜色及宽度-->
        <stroke android:color="#32CD32" android:width="0px" />

    </shape> 

6、linux下安装apk:

./adb push xx.apk  /data/app

猜你喜欢

转载自kunzhong1-yeah-net.iteye.com/blog/1864957
今日推荐