本文整理汇总了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();
}
}