当前位置: 首页>>代码示例>>Java>>正文


Java Status.PENDING属性代码示例

本文整理汇总了Java中android.os.AsyncTask.Status.PENDING属性的典型用法代码示例。如果您正苦于以下问题:Java Status.PENDING属性的具体用法?Java Status.PENDING怎么用?Java Status.PENDING使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.os.AsyncTask.Status的用法示例。


在下文中一共展示了Status.PENDING属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: showUpdateDialog

private void showUpdateDialog() {
    if (updateDialog == null || !updateDialog.isShowing()) {
        if (loader != null
                && (loader.isCancelled() || loader.getStatus() == Status.PENDING)
                && Utils.isConnected(context)) {
            AlertDialog.Builder builder = new AlertDialog.Builder(this);
            updateDialog = builder
                    .setMessage(getString(R.string.msg_updatemap))
                    .setPositiveButton(getString(R.string.msg_yes),
                            MainActivity.this)
                    .setNegativeButton(getString(R.string.msg_no),
                            MainActivity.this).show();
        } else {
            Log.wtf(TAG, "WTF!");
        }
    }
}
 
开发者ID:mohsenoid,项目名称:tehran_traffic_map,代码行数:17,代码来源:MainActivity.java

示例3: startCountDown

public void startCountDown() {
    if (mCountDownTask == null) {
        mCanStartCountDown = true;
    } else if (mCountDownTask.getStatus() == Status.PENDING) {
        mCountDownTask.execute();
    }
}
 
开发者ID:CmoaToto,项目名称:CmoaQuiz,代码行数:7,代码来源:QuestionFragment.java

示例4: displayImage

private void displayImage(AbsListView listView) {
	int firstPos = listView.getFirstVisiblePosition();
	int lastPos = listView.getLastVisiblePosition();
	int totalCount = lastPos - firstPos + 1;
	
	Log.v(TAG, "滚动停止加载图片..");
	for (int i = 0; i < totalCount; i++) {
		View view = listView.getChildAt(i);
		Object tag = view.getTag();
	    if (!(tag instanceof StatusHolder)) {
	    	continue;
	    }
	    
	    StatusHolder holder = (StatusHolder)view.getTag();
	    ImageLoad4ThumbnailTask thumbnailTask = holder.thumbnailTask;
	    if (thumbnailTask != null 
	    	&& thumbnailTask.isCancelled() == false
	    	&& thumbnailTask.getStatus() == Status.PENDING) {
	    	thumbnailTask.execute();
	    }
	    
	    QueryResponseCountTask responseCountTask  = holder.responseCountTask;
	    if (responseCountTask != null
	    	&& responseCountTask.isCancelled() == false
	    	&& responseCountTask.getStatus() == Status.PENDING) {
	    	responseCountTask.execute();
	    }
	}
}
 
开发者ID:cattong,项目名称:YiBo,代码行数:29,代码来源:StatusScrollListener.java

示例5: refreshAction

private void refreshAction() {
    Glide.get(getContext()).clearMemory();
    preferences.removeCache(getDateFromArguments());
    if (this.loadTask == null
            || this.loadTask.getStatus() != Status.PENDING) {
        this.loadTask = new GetStripUrl(getStripURIlListener, preferences,
                getDateFromArguments(), progress);
    }
    this.loadTask.execute();
}
 
开发者ID:smarek,项目名称:Simple-Dilbert,代码行数:10,代码来源:DilbertFragment.java

示例6: connectChatService

/**
 * Connects to the Chat Service
 */

private void connectChatService() {

    //If there already is a pending connect task, remove it since we have a newer one
    if (mConnectRunnable != null) {
        mHandler.removeCallbacks(mConnectRunnable);
    }

    if (mMessageConsumer == null) {
        Logger.e(TAG, "should not happen");
    } else {

        if (isLoggedIn() && !mMessageConsumer.isRunning()) {

            mConnectRunnable = new Runnable() {

                @Override
                public void run() {

                    if (!isLoggedIn()
                            || !DeviceInfo.INSTANCE
                            .isNetworkConnected()) {

                        //If there is no internet connection or we are not logged in, we need not attempt to connect
                        mConnectRunnable = null;
                        return;
                    }

                    mQueueName = generateQueueNameFromUserId(UserInfo.INSTANCE.getId());

                    if (mConnectTask == null) {
                        mConnectTask = new ConnectToChatAsyncTask();
                        mConnectTask.execute(USERNAME, PASSWORD, mQueueName, UserInfo.INSTANCE
                                .getId());
                    } else {
                        final Status connectingStatus = mConnectTask
                                .getStatus();

                        if (connectingStatus != Status.RUNNING) {

                            // We are not already attempting to connect, let's try connecting
                            if (connectingStatus == Status.PENDING) {
                                //Cancel a pending task
                                mConnectTask.cancel(false);
                            }

                            mConnectTask = new ConnectToChatAsyncTask();
                            mConnectTask.execute(USERNAME, PASSWORD, mQueueName, UserInfo.INSTANCE
                                    .getId());
                        }
                    }
                    mConnectRunnable = null;

                }

            };

            mHandler.postDelayed(mConnectRunnable, mCurrentConnectMultiplier
                    * CONNECT_BACKOFF_INTERVAL * 1000);
            mCurrentConnectMultiplier = (++mCurrentConnectMultiplier > MAX_CONNECT_MULTIPLIER) ? MAX_CONNECT_MULTIPLIER
                    : mCurrentConnectMultiplier;
        }
    }

}
 
开发者ID:yeloapp,项目名称:yelo-android,代码行数:68,代码来源:ChatService.java

示例7: connectChatService

/**
 * Connects to the Chat Service
 */
private void connectChatService() {

    //If there already is a pending connect task, remove it since we have a newer one
    if (mConnectRunnable != null) {
        mHandler.removeCallbacks(mConnectRunnable);
    }
    if (isLoggedIn() && !mMessageConsumer.isRunning()) {

        mConnectRunnable = new Runnable() {

            @Override
            public void run() {

                if (!isLoggedIn()
                        || !DeviceInfo.INSTANCE
                        .isNetworkConnected()) {

                    //If there is no internet connection or we are not logged in, we need not attempt to connect
                    mConnectRunnable = null;
                    return;
                }

                mQueueName = generateQueueNameFromUserEmailAndDeviceId(UserInfo.INSTANCE
                                                                               .getEmail(),
                                                                       UserInfo.INSTANCE
                                                                               .getDeviceId()
                );

                if (mConnectTask == null) {
                    mConnectTask = new ConnectToChatAsyncTask();
                    mConnectTask.execute(USERNAME, PASSWORD, mQueueName, UserInfo.INSTANCE
                            .getId());
                } else {
                    final Status connectingStatus = mConnectTask
                            .getStatus();

                    if (connectingStatus != Status.RUNNING) {

                        // We are not already attempting to connect, let's try connecting
                        if (connectingStatus == Status.PENDING) {
                            //Cancel a pending task
                            mConnectTask.cancel(false);
                        }

                        mConnectTask = new ConnectToChatAsyncTask();
                        mConnectTask.execute(USERNAME, PASSWORD, mQueueName, UserInfo.INSTANCE
                                .getId());
                    }
                }
                mConnectRunnable = null;

            }

        };

        mHandler.postDelayed(mConnectRunnable, mCurrentConnectMultiplier
                * CONNECT_BACKOFF_INTERVAL * 1000);
        mCurrentConnectMultiplier = (++mCurrentConnectMultiplier > MAX_CONNECT_MULTIPLIER) ? MAX_CONNECT_MULTIPLIER
                : mCurrentConnectMultiplier;
    }

}
 
开发者ID:barterli,项目名称:barterli_android,代码行数:65,代码来源:ChatService.java


注:本文中的android.os.AsyncTask.Status.PENDING属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。