本文整理匯總了Java中android.os.Handler.Callback.handleMessage方法的典型用法代碼示例。如果您正苦於以下問題:Java Callback.handleMessage方法的具體用法?Java Callback.handleMessage怎麽用?Java Callback.handleMessage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.os.Handler.Callback
的用法示例。
在下文中一共展示了Callback.handleMessage方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: ensureInstanceLoaded
import android.os.Handler.Callback; //導入方法依賴的package包/類
/**
* Callback to ensure the instance has been loaded, either via a loaded, pending
* or missing instance info. This method is safe to call at any time to wait for
* instance info before proceeding with the callback.
*
* @param callback
*/
public void ensureInstanceLoaded(final Callback callback) {
if (currentInstance != null) {
Message msg = Message.obtain();
Bundle data = new Bundle();
data.putBoolean("success", true);
msg.setData(data);
callback.handleMessage(msg);
} else {
// If an instance request is pending, register for a callback on completion,
// otherwise, force an instance request
if (loadingInstance) {
registeredInstanceCallbacks.add(callback);
} else {
reloadInstanceInfo(callback);
}
}
}
示例2: handleMessage
import android.os.Handler.Callback; //導入方法依賴的package包/類
private static void handleMessage(Message message) {
InnerObj innerObj = (InnerObj) message.obj;
Message message2 = innerObj.msg;
Callback callback = innerObj.callback;
if (callback != null) {
callback.handleMessage(message2);
}
}
示例3: handleMessage
import android.os.Handler.Callback; //導入方法依賴的package包/類
private static void handleMessage(Message msg) {
Object[] objs = (Object[]) msg.obj;
Message inner = (Message) objs[0];
Callback callback = (Callback) objs[1];
if (callback != null) {
callback.handleMessage(inner);
}
}
示例4: handleMessage
import android.os.Handler.Callback; //導入方法依賴的package包/類
private static void handleMessage(Message msg) {
Object[] objs = (Object[]) msg.obj;
Message inner = (Message) objs[0];
Callback callback = (Callback) objs[1];
if (callback != null) {
callback.handleMessage(inner);
}
}
示例5: handleSpeciesCallback
import android.os.Handler.Callback; //導入方法依賴的package包/類
private void handleSpeciesCallback(Callback callback, boolean success) {
Message resultMessage = new Message();
Bundle data = new Bundle();
data.putBoolean("success", success);
resultMessage.setData(data);
callback.handleMessage(resultMessage);
}
示例6: handleRegisteredCallbacks
import android.os.Handler.Callback; //導入方法依賴的package包/類
private void handleRegisteredCallbacks(Message msg) {
if (registeredInstanceCallbacks.size() > 0) {
for (Callback registeredCallback : registeredInstanceCallbacks) {
registeredCallback.handleMessage(msg);
}
registeredInstanceCallbacks.clear();
}
}