Code example for Thread

Methods: join

0
            Field f = GalleryPicker.class.getDeclaredField("mWorkerThread");
            f.setAccessible(true);
            Thread t = (Thread)f.get(mActivity);
            //wait till this thread finished 
            Log.d(TAG,TAG2+":testCase01_activityDisplay:call mWorkerThread.join()");
            t.join();
            Log.d(TAG,TAG2+":testCase01_activityDisplay:mWorkerThread.join() returned");
            //get mScanning filed 
            f = GalleryPicker.class.getDeclaredField("mScanning");
            f.setAccessible(true);
            boolean scanning = f.getBoolean(mActivity);
            Log.v(TAG,TAG2+":testCase01_activityDisplay:mScanning="+scanning);
            //get item nums 
            int numItems = mActivity.mNumItems_test;
            Log.d(TAG,TAG2+":testCase01_activityDisplay:mAdapter.mItems.size()="+numItems);
 
            if (numItems == 0) {
                mNoMedia = true;
                Log.d(TAG,TAG2+":testCase01_activityDisplay:mNoMedia="+mNoMedia);
            } else if (numItems == 1) {
                mEnteredOnlyFolder = true;