How to call a function only after opening an application?
I would like open custom function only after opening application.
Now I call this function in MainActivity. This is call after start, but if I go to other Activity and next back to MainActivity, then this function is recall.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
myFunction();
}
I don't want use BOOT_COMPLETED, because I want to it start only if I open my app.