I am trying to get an Android application to run some code on startup from the launchpad before launching into action. That is, I want my application to start with Sub Main
, and not in the first place.
Essentially, in pseudo, I want to do something like this:
void main() {
doSomeInitializationStuff();
startActivity(myFirstActivity);
}
According to this question , it seems that Android does not have this concept literally. Therefore, I looked at creating invisible activity as an entry point, but I cannot figure out how to make activity invisible. I tried these two methods, which seem to be the only ones that appear in my searches, but they don't seem to do anything ...
this.setVisible(false);
this.setTheme(android.R.style.Theme_Translucent_NoTitleBar);
source
share