This Handler class should be static or leaks might occur

2015-11-26 • • 暂无评论

Handler 类应该应该为static类型,否则有可能造成泄露。在程序消息队列中排队的消息保持了对目标Handler类的应用。如果Handler是个内部类,那 么它也会保持它所在的外部类的引用。为了避免泄露这个外部类,应该将Handler声明为static嵌套类,并且使用对外部类的弱应用。

    static class MyHandler extends Handler
{
    WeakReference<PopupActivity> mActivity;
    MyHandler(PopupActivity activity)
    {
        mActivity = new WeakReference<PopupActivity>(activity);
    }
    @Override
    public void handleMessage(Message msg)
    {
        PopupActivity theActivity = mActivity.get();
        switch (msg.what)
        {
        case 0:
            theActivity.popPlay.setChecked(true);
            break;
        }
    }
}
MyHandler ttsHandler = new MyHandler(this);
private Cursor mCursor;

private void test()
{
    ttsHandler.sendEmptyMessage(0);
}

使用Handler处理异步消息的导包

2015-11-26 • • 暂无评论

在导入包的时候需要的是

import android.os.Handler;
import android.os.Message;  

导入错误会导致sendMessage函数不被认可。

部分端口作用

2015-11-22 • • 暂无评论

KMS

135,1688

各种激活码

2015-11-22 • • 暂无评论

process lasso激活码

W-4CD2S3-KAV3GF-S4ZYAW

VMware Workstation 12 Pro

5A02H-AU243-TZJ49-GTC7K-3C61N  

office 2007

DBXYD-TF477-46YM4-W74MH-6YDQ8  

Beyond Compare对比工具 v4.1.3

--- BEGIN LICENSE KEY ---
Fo7lH0ughgFtGPKAHfwe++uxz+tXUDoTEfAdG4AzBIAKfDdIkBGdtGeEreevnWFQgD5GsGCV5kuGI5afF3b2LdJzJXE6YVapYW7f+tRRXRFI4yn4NjjZ0RiiqGRCTVzwComUcXB-eiFWRBY6JpSsCNkmIxL5KsRCo442djHhTZE+
--- END LICENSE KEY -----

proxifier 2.14

L6Z8A-XY2J4-BTZ3P-ZZ7DF-A2Q9C(Portable Edition)
5EZ8G-C3WL5-B56YG-SCXM9-6QZAP(Standard Edition)
P427L-9Y552-5433E-8DSR3-58Z68(MAC)

RealVNC 5.1破解

BQ24G-PDXE4-KKKRS-WBHZE-F5RCA
BQ24G-PDXE4-KKKRS-WBHZE-F5RCA
8ZEZH-QPANM-NX3A5-8C4TS-8B97A
7AB4X-3YNXF-C5MRR-59DJG-7HGNA
UPL8P-CN2MT-85ERA-N3E3B-GERDA
X24XP-V247M-HEMNV-ZTMZK-FNB7A

添加Mysql缓存

2015-11-20 • • 暂无评论

query_cache_size=128M

query_cache_type=1