Method 1:
Private void startLoadBitmapThread (){
(New ReadBitmapRunnable (this, this. getContentResolver (). run ();
}
Method 2:
Private void startLoadBitmapThread (){
Thread thread = new Thread (new ReadBitmapRunnable (this, this. getContentResolver ()));
Thread. start ();
}
Thread class: www.2cto.com
Class ReadBitmapRunnable implements Runnable {
Private Activity mActivity;
Private ContentResolver mContentResolver;
Public ReadBitmapRunnable (Activity pActivity, ContentResolver pContentResolver ){
MActivity = pActivity;
MContentResolver = pContentResolver;
}
@ Override
Public void run (){
// TODO Auto-generated method stub
GinwaveDataSource. readAllAlbumPicture (mActivity, mContentResolver );
GinwaveDataSource. readAllWhiteAlbumPicture (mActivity, mContentResolver );
}
}
Method 1: The start thread will block the main thread, but method 2 will not block the main thread. The difference between the two is not clear yet.
From the column xiaoxiaobian3310903