當前位置: 首頁>>代碼示例>>Java>>正文


Java Status.RUNNING屬性代碼示例

本文整理匯總了Java中android.os.AsyncTask.Status.RUNNING屬性的典型用法代碼示例。如果您正苦於以下問題:Java Status.RUNNING屬性的具體用法?Java Status.RUNNING怎麽用?Java Status.RUNNING使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在android.os.AsyncTask.Status的用法示例。


在下文中一共展示了Status.RUNNING屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: startRecordingCellInfo

/**
 * cell recording을 위한 thread를 실행한다. <p/>
 * cell recording task는 오직 한개만 실행 가능하고, 일정한 주기로 cell 정보를 수집하여 저장한다. <p/>
 * @return cell recording task 실행결과.
 */
public boolean startRecordingCellInfo() {
    if (mCellInfoTask == null) {
        mCellInfoTask = new CellInfoTask();
    }

    mCellInfoTask.clearCellInfo();

    Status status = mCellInfoTask.getStatus();
    if (status == Status.PENDING) {
        mCellInfoTask.execute();
        return true;
    } else if (status == Status.RUNNING) {
        return true;
    } else if (status == Status.FINISHED) {
        mCellInfoTask = new CellInfoTask();
        mCellInfoTask.execute();
        return true;
    }

    return false;
}
 
開發者ID:ddinsight,項目名稱:dd-collector,代碼行數:26,代碼來源:AirplugAnalyticTracker.java

示例2: inverseTask

/**
 * Permet de changer l'ordre de chargement des pages
 * @param targetPageNumber
 */
private void inverseTask(int targetPageNumber)
{
	// Si une t�che est en cours
	if (preLoadingPostsAsyncTask != null && preLoadingPostsAsyncTask.getStatus() == Status.RUNNING)
	{
		// si la page pr�c�dente n'est en cours de chargement
		if (preLoadingPostsAsyncTask.getPageNumber() != targetPageNumber)
		{
			// Sinon on force le chargement de la page pr�c�dente
			int interruptedPageNumber = preLoadingPostsAsyncTask.getPageNumber();
			preLoadingPostsAsyncTask.cancel(true);
			preLoadingPostsAsyncTask = new PreLoadingPostsAsyncTask(PostsActivity.this, interruptedPageNumber);
			preLoadingPostsAsyncTask.execute(targetPageNumber, topic);
		}
	}
}
 
開發者ID:Draluy,項目名稱:HFRFirefoxOS,代碼行數:20,代碼來源:PostsActivity.java

示例3: fullScreenClickShowAndHide

private void fullScreenClickShowAndHide(boolean show) {
    LogInfo.log(RxBus.TAG, "全屏控製欄顯示:" + show);
    if (show) {
        this.mTopBar.setVisibility(0);
        this.mBottomBar.setVisibility(0);
        if (LiveLunboUtils.isLunBoWeiShiType(this.pageIndex)) {
            this.mChannelBtn.setVisibility(0);
        }
        if (this.mLiveBarrageController == null || !this.mLiveBarrageController.getBarrageControl().isOpenBarrage()) {
            this.mBarrageInputBtn.setVisibility(4);
        } else {
            this.mBarrageInputBtn.setVisibility(0);
        }
        if (this.mCanWatchAndBuy) {
            this.mCartLayout.setVisibility(0);
            if (this.mCartShowingSubscription != null) {
                LogInfo.log(RxBus.TAG, "取消監聽購物車按鈕消失的通知");
                this.mCartShowingSubscription.unsubscribe();
            }
        }
        if (!(LiveLunboUtils.isLunBoWeiShiType(this.pageIndex) || this.mBaseBean == null || this.mBaseBean.branchType <= 0 || this.mBaseBean.isBranch != 1 || BaseTypeUtils.isListEmpty(this.mBaseBean.branches))) {
            this.mBtnMultiProgram.setVisibility(0);
        }
    } else {
        this.mTopBar.setVisibility(8);
        this.mBottomBar.setVisibility(8);
        if (LiveLunboUtils.isLunBoWeiShiType(this.pageIndex)) {
            this.mChannelBtn.setVisibility(8);
        }
        this.mBarrageInputBtn.setVisibility(4);
        hideFloatView();
        setLevelTipVisible(false);
        if (this.mCartLayout.getVisibility() == 0 && !this.mWacthAndBuyFloatView.isShowing() && this.mWatchAndBuyCartListView.getVisibility() != 0 && ((this.mCartTask == null || this.mCartTask.getStatus() != Status.RUNNING) && this.mWatchAndBuyCartListView.getVisibility() != 0)) {
            this.mCartLayout.setVisibility(8);
        }
        this.mBtnMultiProgram.setVisibility(8);
    }
    RxBus.getInstance().send("rx_bus_live_home_action_update_system_ui");
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:39,代碼來源:LivePlayerController.java

示例4: loadImage

/**
 *
 */
private void loadImage() {
    if (retrieveImageTask != null
            && retrieveImageTask.getStatus() == Status.RUNNING) {
        return;
    }
    retrieveImageTask = new RetrieveImageTask(this);
    Log.d(getClass().getName(),
            "showImage(" + imageUris.get(currentImageIndex) + ")");
    retrieveImageTask.execute(imageUris.get(currentImageIndex));
}
 
開發者ID:theopenbit,項目名稱:yaacc-code,代碼行數:13,代碼來源:ImageViewerActivity.java

示例5: onActivityCreated

@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public void onActivityCreated(Bundle savedInstanceState) {
	super.onActivityCreated(savedInstanceState);
	if (passwordList == null) {
		if (thread.getStatus() == Status.FINISHED
				|| thread.getStatus() == Status.RUNNING)
			thread = new KeygenThread(wifiNetwork);
		if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.GINGERBREAD_MR1) {
			thread.execute();
		} else {
			thread.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
		}
	}
}
 
開發者ID:yolosec,項目名稱:upcKeygen,代碼行數:14,代碼來源:NetworkFragment.java

示例6: onQueryTextSubmit

@Override
public boolean onQueryTextSubmit(String query) {
    if ((mTask != null) && (mTask.getStatus() == Status.RUNNING)) {
        return false;
    }

    mQuery = query;


    mTask = new SearchTask(getActivity());
    mTask.execute(query);
    return false;
}
 
開發者ID:metinkale38,項目名稱:prayer-times-android,代碼行數:13,代碼來源:HadithFragment.java

示例7: onPause

public void onPause(org.exoplatform.base.BaseActivity act) {
  if (act == mContext) {
    // TODO implement correct behavior, current only dismissUI and cancel current task
    if (Log.LOGD)
      Log.d(TAG, "onPause cancel task");
    setListener(null);
    if (mLoginTask != null && mLoginTask.getStatus() == Status.RUNNING) {
      mLoginTask.cancel(true);
    }
    dismissDialog();
  }
}
 
開發者ID:paristote,項目名稱:mobile-android-studio,代碼行數:12,代碼來源:LoginProxy.java

示例8: onStop

@Override
public void onStop() {
	super.onStop();
	
	//Stop any running tasks
	if(socialLoader != null) {
		if(socialLoader.getStatus() == Status.RUNNING) {
			socialLoader.cancel(true);
		}
	}
}
 
開發者ID:abartmatozu,項目名稱:forum-fiend-osp,代碼行數:11,代碼來源:SocialFragment.java

示例9: onStop

@Override
public void onStop() {
	super.onStop();
	
	//Stop any running tasks
	if(mailDownloader != null) {
		if(mailDownloader.getStatus() == Status.RUNNING) {
			mailDownloader.cancel(true);
		}
	}
}
 
開發者ID:abartmatozu,項目名稱:forum-fiend-osp,代碼行數:11,代碼來源:MailFragment.java

示例10: endCurrentlyRunning

private void endCurrentlyRunning() {
	//Stop any running tasks
	if(categoriesDownloader != null) {
		if(categoriesDownloader.getStatus() == Status.RUNNING) {
			categoriesDownloader.cancel(true);
			Log.i("Forum Fiend","Killed Currently Running");
		}
	}
}
 
開發者ID:abartmatozu,項目名稱:forum-fiend-osp,代碼行數:9,代碼來源:CategoriesFragment.java

示例11: endCurrentlyRunning

private void endCurrentlyRunning() {
	//Stop any running tasks
	if(postsDownloader != null) {
		if(postsDownloader.getStatus() == Status.RUNNING) {
			postsDownloader.cancel(true);
		}
	}
}
 
開發者ID:abartmatozu,項目名稱:forum-fiend-osp,代碼行數:8,代碼來源:PostsFragment.java

示例12: loadImages

/**
 * 加載圖片
 */
private void loadImages() {
    mLoadingLayout.showLoading(true);
    if (!SDcardUtil.hasExternalStorage()) {
        mLoadingLayout.showEmpty(getString(R.string.donot_has_sdcard));
        return;
    }

    // 線程正在執行
    if (mLoadTask != null && mLoadTask.getStatus() == Status.RUNNING) {
        return;
    }

    mLoadTask = new ImageLoadTask(this, new OnTaskResultListener() {
        @SuppressWarnings("unchecked")
        @Override
        public void onResult(boolean success, String error, Object result) {
            mLoadingLayout.showLoading(false);
            // 如果加載成功
            if (success && result != null && result instanceof ArrayList) {
                setImageAdapter((ArrayList<ImageGroup>)result);
            } else {
                // 加載失敗,顯示錯誤提示
                mLoadingLayout.showFailed(getString(R.string.loaded_fail));
            }
        }
    });
    TaskUtil.execute(mLoadTask);
}
 
開發者ID:likebamboo,項目名稱:ImageChooser,代碼行數:31,代碼來源:MainActivity.java

示例13: resetRecords

/**
 * Reload form record list for current filter status and collect pertinent
 * text data using FormRecordLoaderTask; results will then be re-filtered
 * and displayed via callbacks.
 */
public void resetRecords() {
    // reload the form records, even if they are currently being loaded
    if (loader.getStatus() == Status.RUNNING) {
        loader.cancel(false);
        loader = loader.spawn();
    } else if (loader.getStatus() == Status.FINISHED) {
        loader = loader.spawn();
    }

    SqlStorage<FormRecord> storage = CommCareApplication.instance().getUserStorage(FormRecord.class);

    // choose a default filter if none set
    if (filter == null) {
        filter = FormRecordFilter.SubmittedAndPending;
    }

    records.clear();
    String currentAppId = CommCareApplication.instance().getCurrentApp().getAppRecord().getApplicationId();
    // Grab all form records that satisfy ANY of the statuses in the filter, AND belong to the
    // currently seated app
    for (String status : filter.getStatus()) {
        records.addAll(storage.getRecordsForValues(
                new String[]{FormRecord.META_STATUS, FormRecord.META_APP_ID},
                new Object[]{status, currentAppId}));
    }

    sortRecordsInReverseChronological();
    searchCache.clear();
    current.clear();
    notifyDataSetChanged();

    // load specific data about the 'records' into the searchCache, such as
    // record title, form name, modified date
    loader.init(searchCache, names);
    loader.executeParallel(records.toArray(new FormRecord[records.size()]));
}
 
開發者ID:dimagi,項目名稱:commcare-android,代碼行數:41,代碼來源:IncompleteFormListAdapter.java

示例14: onResume

@Override
public void onResume() {
    super.onResume();
    if (mTask != null && mTask.getStatus() != Status.RUNNING && mRace != null) {
        fetchLadder();
    }
}
 
開發者ID:jrobinson3k1,項目名稱:Path-of-Exile-Racer,代碼行數:7,代碼來源:LadderFragment.java

示例15: onDestroy

@Override
protected void onDestroy()
{
    super.onDestroy();
    
    if (initMediaTask != null && initMediaTask.getStatus() == Status.RUNNING) {
        initMediaTask.cancel(false);
    }
}
 
開發者ID:fblandroidhackathon,項目名稱:persontracker,代碼行數:9,代碼來源:GalleryActivity.java


注:本文中的android.os.AsyncTask.Status.RUNNING屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。