Intent intent = new Intent(null, Uebung2.class);
You must supply Intent
constructor a valid Context
instead of a null
.
What to use depends on the context (sic) where your code is. Use ActivityName.this
to refer to the outer activity class in case the nested inner class is in fact in an activity.
Also, consider using just handler.postDelayed()
for producing a delay instead of Thread.sleep()
in a background thread.