2

I am writing a security type app that sometimes needs to be opened from a background service. To open it, I use:

  Log.i("MY_DEBUG_TAG_CORE", "Starting Launch");
  Intent i= new Intent(this, MainActivity.class);
  i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  this.startActivity(i);
  Log.i("MY_DEBUG_TAG_CORE", "Launch Completed")

In most circumstances, my application opens almost instantly. However, when the above code is called while a launcher app (TouchWiz Home, Nova Launcher, etc) is active, it takes five to ten seconds to open. I get "Starting Launch" and "Launch Completed" in LogCat, and then the long delay, before the app is launched.

Nothing different appears in LogCat or the console when this delay happens. Why is this happening? How can I fix this?

msbg
  • 4,852
  • 11
  • 44
  • 73

0 Answers0