安卓获取线程id

错误的做法:

1     @Override
2     public void onCreate() {
3         mContext = getApplicationContext();
4         mHandler = new Handler();
5         mMainThreadid = android.os.Process.myPid();
6         super.onCreate();
7     }

正确的做法:

1     @Override
2     public void onCreate() {
3         mContext = getApplicationContext();
4         mHandler = new Handler();
5         mMainThreadid = android.os.Process.myTid();
6         super.onCreate();
7     }

 

posted @ 2016-07-10 22:16  达哥的博客  阅读(5401)  评论(0编辑  收藏  举报