use of android.os.Message in project okhttp-OkGo by jeasonlzy.
the class PriorityAsyncTask method postResult.
private Result postResult(Result result) {
@SuppressWarnings("unchecked") Message message = sHandler.obtainMessage(MESSAGE_POST_RESULT, new AsyncTaskResult<Result>(this, result));
message.sendToTarget();
return result;
}
use of android.os.Message in project SmartAndroidSource by jaychou2012.
the class AsyncHttpResponseHandler method obtainMessage.
/**
* Helper method to create Message instance from handler
*
* @param responseMessageId constant to identify Handler message
* @param responseMessageData object to be passed to message receiver
* @return Message instance, should not be null
*/
protected Message obtainMessage(int responseMessageId, Object responseMessageData) {
Message msg;
if (handler == null) {
msg = Message.obtain();
if (msg != null) {
msg.what = responseMessageId;
msg.obj = responseMessageData;
}
} else {
msg = Message.obtain(handler, responseMessageId, responseMessageData);
}
return msg;
}
use of android.os.Message in project SmartAndroidSource by jaychou2012.
the class AsyncTask method postResult.
private Result postResult(Result result) {
@SuppressWarnings("unchecked") Message message = sHandler.obtainMessage(MESSAGE_POST_RESULT, new AsyncTaskResult<Result>(this, result));
message.sendToTarget();
return result;
}
use of android.os.Message in project Crouton by keyboardsurfer.
the class Manager method sendMessageDelayed.
/**
* Sends a {@link Crouton} within a delayed {@link Message}.
*
* @param crouton
* The {@link Crouton} that should be sent.
* @param messageId
* The {@link Message} id.
* @param delay
* The delay in milliseconds.
*/
private void sendMessageDelayed(Crouton crouton, final int messageId, final long delay) {
Message message = obtainMessage(messageId);
message.obj = crouton;
sendMessageDelayed(message, delay);
}
use of android.os.Message in project Klyph by jonathangerbaud.
the class BirthdayService method onStartCommand.
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
Message msg = mServiceHandler.obtainMessage();
msg.arg1 = startId;
mServiceHandler.sendMessage(msg);
// If we get killed, after returning from here, restart
return START_STICKY;
}
Aggregations