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


Java Callback.handleMessage方法代码示例

本文整理汇总了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);
        }
    }
}
 
开发者ID:OpenTreeMap,项目名称:otm-android,代码行数:26,代码来源:App.java

示例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);
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:9,代码来源:UIHandler.java

示例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);
	}
}
 
开发者ID:BigAppOS,项目名称:BigApp_Discuz_Android,代码行数:9,代码来源:UIHandler.java

示例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);
    }
}
 
开发者ID:BigAppOS,项目名称:BigApp_Discuz_Android,代码行数:9,代码来源:UIHandler.java

示例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);
}
 
开发者ID:OpenTreeMap,项目名称:otm-android,代码行数:8,代码来源:FilterManager.java

示例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();
    }
}
 
开发者ID:OpenTreeMap,项目名称:otm-android,代码行数:9,代码来源:App.java


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