Search in sources :

Example 6 with Message

use of android.os.Message in project nmid-headline by miao1007.

the class OnekeyShare method onError.

public void onError(Platform platform, int action, Throwable t) {
    t.printStackTrace();
    Message msg = new Message();
    msg.what = MSG_ACTION_CCALLBACK;
    msg.arg1 = 2;
    msg.arg2 = action;
    msg.obj = t;
    UIHandler.sendMessage(msg, this);
    // 分享失败的统计
    ShareSDK.logDemoEvent(4, platform);
}
Also used : Message(android.os.Message)

Example 7 with Message

use of android.os.Message in project c-geo by just-radovan.

the class cgeocaches method switchList.

public void switchList(int id, int order) {
    cgList list = null;
    if (id >= 0) {
        list = app.getList(id);
    } else if (order >= 0) {
        lists = app.getLists();
        list = lists.get(order);
    } else {
        return;
    }
    if (list == null) {
        return;
    }
    listId = list.id;
    title = list.title;
    settings.saveLastList(listId);
    base.showProgress(activity, true);
    setLoadingCaches();
    Handler handlerMove = new Handler() {

        @Override
        public void handleMessage(Message msg) {
            Thread threadPure = new geocachesLoadByOffline(loadCachesHandler, latitude, longitude, msg.what);
            threadPure.start();
        }
    };
    (new moveCachesToList(listId, handlerMove)).start();
}
Also used : Message(android.os.Message) Handler(android.os.Handler)

Example 8 with Message

use of android.os.Message in project c-geo by just-radovan.

the class cgeogpxes method listDir.

private void listDir(ArrayList<File> list, File directory) {
    if (directory == null || directory.isDirectory() == false || directory.canRead() == false) {
        return;
    }
    final File[] listPre = directory.listFiles();
    if (listPre != null && listPre.length > 0) {
        final int listCnt = listPre.length;
        for (int i = 0; i < listCnt; i++) {
            if (endSearching == true) {
                return;
            }
            if (listPre[i].canRead() == true && listPre[i].isFile() == true) {
                final String[] nameParts = listPre[i].getName().split("\\.");
                if (nameParts.length > 1) {
                    final String extension = nameParts[(nameParts.length - 1)].toLowerCase();
                    if (extension.equals("gpx") == false) {
                        continue;
                    }
                } else {
                    // file has no extension
                    continue;
                }
                // add file to list
                list.add(listPre[i]);
            } else if (listPre[i].canRead() == true && listPre[i].isDirectory() == true) {
                final Message msg = new Message();
                String name = listPre[i].getName();
                if (name.substring(0, 1).equals(".") == true) {
                    // skip hidden directories
                    continue;
                }
                if (name.length() > 16) {
                    name = name.substring(0, 14) + "...";
                }
                msg.obj = name;
                changeWaitDialogHandler.sendMessage(msg);
                // go deeper
                listDir(list, listPre[i]);
            }
        }
    }
    return;
}
Also used : Message(android.os.Message) File(java.io.File)

Example 9 with Message

use of android.os.Message in project qksms by moezbhatti.

the class ShouldIAnswerBinder method getNumberRating.

public void getNumberRating(String number) throws RemoteException {
    Message msg = new Message();
    msg.what = 1;
    Bundle data = new Bundle();
    data.putString("number", number);
    msg.setData(data);
    msg.replyTo = messenger;
    serviceMessenger.send(msg);
}
Also used : Message(android.os.Message) Bundle(android.os.Bundle)

Example 10 with Message

use of android.os.Message in project okhttp-OkGo by jeasonlzy.

the class DownloadTask method postMessage.

private void postMessage(String errorMsg, Exception e) {
    //发消息前首先更新数据库
    DownloadDBManager.INSTANCE.update(mDownloadInfo);
    DownloadUIHandler.MessageBean messageBean = new DownloadUIHandler.MessageBean();
    messageBean.downloadInfo = mDownloadInfo;
    messageBean.errorMsg = errorMsg;
    messageBean.e = e;
    Message msg = mDownloadUIHandler.obtainMessage();
    msg.obj = messageBean;
    mDownloadUIHandler.sendMessage(msg);
}
Also used : Message(android.os.Message)

Aggregations

Message (android.os.Message)3198 Handler (android.os.Handler)347 RemoteException (android.os.RemoteException)263 Bundle (android.os.Bundle)210 Test (org.junit.Test)144 Intent (android.content.Intent)130 IOException (java.io.IOException)124 Point (android.graphics.Point)86 HashMap (java.util.HashMap)77 SomeArgs (com.android.internal.os.SomeArgs)67 SmallTest (android.test.suitebuilder.annotation.SmallTest)64 Messenger (android.os.Messenger)63 ArrayList (java.util.ArrayList)59 View (android.view.View)52 File (java.io.File)50 MediumTest (android.test.suitebuilder.annotation.MediumTest)43 TextView (android.widget.TextView)41 IBinder (android.os.IBinder)38 Map (java.util.Map)37 PendingIntent (android.app.PendingIntent)33