當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。