I have code for an android app within android studio to run a method after a 1 second delay:
    new java.util.Timer().schedule(
            new java.util.TimerTask() {
                @Override
                public void run() {
                    loginClicked();
                }
            },
            1000
    );
However, it produces this error every time it executes:
java.lang.IllegalThreadStateException: A Looper must be associated with this thread.
I've basically grabbed it from this, so I don't really know what's up.
 
    