I had a problem creating a handler in new thread. This is my code:
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(
You could also use a HandlerThread like this:
HandlerThread
HandlerThread thread = new HandlerThread("MyHandlerThread"); thread.start(); Handler handler = new Handler(thread.getLooper());
HandlerThreads have a Looper associated with them, so this wouldn't throw an exception.
Looper