Context getMainLooper - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Context getMainLooper method.

This code example shows how to use the following methods:getBroadcast, getMainLooper, getSystemService
9
CodeRank
This code example shows how to use the following methods:getCacheDir, getFilesDir, getMainLooper
    // Dispatch a round of property updates, should only be called on UI thread 
 
    public static native void pollCourier(); 
 
    public static void init(Context ctx) {
        courier = new Handler(ctx.getMainLooper(), new Handler.Callback() {
                public boolean handleMessage(Message msg) {
                    pollCourier(); 
                    return true; 
                } 
            }); 
 
        coreInit(ctx.getFilesDir().getPath(), ctx.getCacheDir().getPath());
    } 
 
    public static void wakeupMainDispatcher() { 
        courier.sendEmptyMessage(0);
    } 
 
 
7
CodeRank
This code example shows how to use the following methods:getMainLooper, getSystemService
    private TouchExplorer mTouchExplorer;
 
    private int mTouchscreenSourceDeviceId;
 
    public AccessibilityInputFilter(Context context, AccessibilityManagerService service) {
        super(context.getMainLooper());
        mContext = context;
        mAms = service;
        mPm = (PowerManager)context.getSystemService(Context.POWER_SERVICE);
    } 
 
    @Override 
    public void onInstalled() { 
        if (DEBUG) {
            Slog.d(TAG, "Accessibility input filter installed.");
        } 
        mTouchExplorer = new TouchExplorer(this, mContext, mAms);
        super.onInstalled(); 
    } 
 
7
CodeRank
This code example shows how to use the following methods:getBroadcast, getMainLooper, getSystemService
7
CodeRank

Related Context getMainLooper Questions & Answers:

getMainLooper Method Overview
Return the Looper for the main thread of the current process.
See Code Examples for other Android Context Methods: