本文整理匯總了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;
}
示例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);
}
}
}
示例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");
}
示例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));
}
示例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);
}
}
}
示例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;
}
示例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();
}
}
示例8: onStop
@Override
public void onStop() {
super.onStop();
//Stop any running tasks
if(socialLoader != null) {
if(socialLoader.getStatus() == Status.RUNNING) {
socialLoader.cancel(true);
}
}
}
示例9: onStop
@Override
public void onStop() {
super.onStop();
//Stop any running tasks
if(mailDownloader != null) {
if(mailDownloader.getStatus() == Status.RUNNING) {
mailDownloader.cancel(true);
}
}
}
示例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");
}
}
}
示例11: endCurrentlyRunning
private void endCurrentlyRunning() {
//Stop any running tasks
if(postsDownloader != null) {
if(postsDownloader.getStatus() == Status.RUNNING) {
postsDownloader.cancel(true);
}
}
}
示例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);
}
示例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()]));
}
示例14: onResume
@Override
public void onResume() {
super.onResume();
if (mTask != null && mTask.getStatus() != Status.RUNNING && mRace != null) {
fetchLadder();
}
}
示例15: onDestroy
@Override
protected void onDestroy()
{
super.onDestroy();
if (initMediaTask != null && initMediaTask.getStatus() == Status.RUNNING) {
initMediaTask.cancel(false);
}
}