获取状态栏高度 一.传统方式:有时获取为0,解决方法看 二 1 2 3 4 代码 Rect frame = new Rect(); getWindow().getDecorView().getWindowVisibleDisplayFrame(frame); int statusBarHeight = frame.top; 二.4.0.3之后可能获取为0 public int getBarHeight(){ Class<?> c = null; Objec…
首先,先贴上样本代码 //检查权限 public void checkPermission() { if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { ActivityCompat.requestPermissions(this, new String[]{Manifest.permission…
在${user.home}/project.properties文件中设置proguard.config属性 # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.…
目录: 一.Viewpager的简单介绍 二.简单的Viewpager使用 三.简单显示图片的Viewpager实现 四.广告图的实现及Viewpager指示器(小圆点)的实现 五.APP引导页的实现 一.ViewPager介绍 官方文档解释: Layout manager that allows the user to flip left and right through pages of data. You supply an implementation of a PagerAdapte…