asysbang

标题: 细节记录 [打印本页]

作者: admin    时间: 2015-3-25 10:11
标题: 细节记录
TextView   drawableTop在xml文件中很容易实现
代码中setCompoundDrawablesWithIntrinsicBounds  要用这个函数实现

设置界面可以用preferenceactivity,
如果是2层的设置可以用onBuildHeaders,
如果是1层的设置那么直接把fragment添加到activity中就可以


actionbar上面多个按钮,默认多个的话会显示3个点的按钮,然后点击这个弹出多余的菜单
也可以只定义3个基本的菜单,然后给每个菜单添加ActionProvider 这样每个菜单都可以弹出子菜单了

当滑动事件或者点击事件冲突时 可以用  requestDisallowInterceptTouchEvent  这个函数试试

PagerSlidingTabStrip  这个实现滑动的tab 同时和actionbar兼容比较好

http://blog.csdn.net/loongggdroid/article/details/9469935
用fragmentactivity和radiogroup 实现下面的tab

当需要对Application 做单例模式时不需要重新写构造函数
直接private static MmsApp sMmsApp = null;  在oncreate函数sMmsApp = this;  然后通过synchronized public static MmsApp getApplication() {return sMmsApp;}来调用这个“单例”

抽象的abstract class BackgroundLoaderManager

回调接口
public interface IModelChangedObserver {
    void onModelChanged(Model model, boolean dataChanged);
}

DrmManagerClient Client

return 自定义对象

android创建FullscreenActivity  会有个点击隐藏的动画,各种地方添加动画效果

CopyOnWriteArrayList  线程安全的list

线程池的使用
        final LinkedBlockingQueue<Runnable> queue = new LinkedBlockingQueue<Runnable>();
        final int poolSize = MAX_THREADS;
        mExecutor = new ThreadPoolExecutor(
                poolSize, poolSize, 5, TimeUnit.SECONDS, queue,
                new BackgroundLoaderThreadFactory(getTag()));




openOrCreateDatabase 用这个函数读取指定目录下的数据库(前提是有权限)


应用程序调用“su”,主要是保存运行su的管道
    this.p = Runtime.getRuntime().exec(this.mShell);
    this.o = this.p.getOutputStream();
    之后的命令都往this.o里面发送
this.o.write(("LD_LIBRARY_PATH=/vendor/lib:/system/lib " + paramString + "\n").getBytes("ASCII"));












欢迎光临 asysbang (http://asysbang.com/) Powered by Discuz! X2.5