I get this error and my application crashes:
java.lang.IllegalStateException: The current thread must have a looper!
I didnβt really understand how to use looper on Google, I use streams (mainly for the sleep function), a handler (for loading the image when the Async task starts) and Async (for getting JSON data from the URL). I do not know how to solve this problem, so any suggestions would be helpful.
This is the code for the thread that executes when the button is clicked:
View view = flingContainer.getSelectedView(); view.findViewById(R.id.item_swipe_right_indicator).setAlpha((float) 1.0); Thread timer = new Thread() { public void run() { try { sleep(320); } catch (InterruptedException e) { e.printStackTrace(); } finally { flingContainer.getTopCardListener().selectLeft(); } } }; timer.start();
I use this libray and log-cat: 
where: at com.enormous.quotesgram.MainActivity$3.run(MainActivity.java:479) in the last in log-cat corresponds to the line: flingContainer.getTopCardListener().selectLeft(); in the above code snippet.
source share