1,布局过于复杂:xml布局文件可能存在深层嵌套或者组件过多;
2,重复绘制:一个界面的某一点可能在同一时间进行了多次绘制;
3,内存抖动:系统内存是有限的,系统经常会将不活跃的进程置入外存中就是常说的虚拟内存,当调用它时再把它从外存转入内存,内存外存转换频率过大就会导致内存抖动;
4,性能瓶颈: 任务过多且执行调度不够好;
5,历史问原因,老代码以及设计问题;
6,团队人众多员 ,存在过多的代码合并和插入问题;
7,个别程序员的渣代码
卡顿优化解决方案:
1,减低布局的复杂度;
2,单线程任务不要太多;
3,适当调度;
4,将一些计算分担给服务器端
去标题
getSupportActionBar().hide();
去状态栏
getWindow()
.setFlags(WindowManager.LayoutParams
.FLAG_FULLSCREEN, WindowManager.LayoutParams
.FLAG_FULLSCREEN);
沉浸式
//透明状态栏
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
//透明导航栏
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
android:fitsSystemWindows="true"
android:clipToPadding="true"
//其他
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
//透明状态栏 getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
//透明导航栏 getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
SystemBarTintManager tintManager = new SystemBarTintManager(this);
// 激活状态栏 tintManager.setStatusBarTintEnabled(true);
// enable navigation bar tint 激活导航栏 tintManager.setNavigationBarTintEnabled(true);
//设置系统栏设置颜色
//tintManager.setTintColor(R.color.red);
//给状态栏设置颜色
tintManager.setStatusBarTintResource(R.color.mask_tags_1);
//Apply the specified drawable or color resource to the system navigation bar.
//给导航栏设置资源 tintManager.setNavigationBarTintResource(R.color.mask_tags_1); }
jar包
compile'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
compile'org.xutils:xutils:3.5.0'https://github.com/wyouflf/xUtils3
3.
http://www.cnblogs.com/JohnTsai/p/4715454.html
compile 'com.android.support:design:22.2.0' 后面的22.2.0要和v7包的版本一致
-- TableLayout
4.
http://blog.csdn.net/lmj623565791/article/details/36677279
http://blog.csdn.net/lmj623565791/article/details/36677279 SlidingMenu侧滑菜单
5
网络判断跳转到网络界面
http://blog.csdn.net/wangjia55/article/details/7924664
我的文档
http://note.youdao.com/noteshare?id=8f6eb09c2d2a8cf43f4c833f09731a14
studio设置自动导包:
http://blog.csdn.net/buaaroid/article/details/44979629