安卓获取线程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 }