Skip to content

Instantly share code, notes, and snippets.

View linroid's full-sized avatar

Lin Zhang linroid

View GitHub Profile
import android.os.Handler;
import android.os.Looper;
* @author linroid <>
* @since 25/11/2016
public class SafetyUtils {
public static void removeCallbacks(final Handler handler, final Runnable callback) {
if (handler.getLooper() == Looper.myLooper()) {
linroid /
Created November 9, 2016 04:44
Android Orientation Resource Loader
package com.linroid.androidorientation;
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.util.DisplayMetrics;
import java.lang.reflect.Method;
* Copyright 2014 Chris Banes
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Unless required by applicable law or agreed to in writing, software