Inside onCreate
of Application
class, I set its instance to a static field, then show all application Toast
s through this context. All works good except one thing, in some places a Toast
can be shown before first activity can even appear but Toast
never appears or sometimes just flashes. I think its because Activity not shown or drawn yet ? Or I'm missing something.
Edit:
More like showing toast from onCreate
of Application
class
Edit 2 :
public class TestApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
Toast.makeText(this, "Test from App", Toast.LENGTH_LONG).show();
}
}