lundi 4 mai 2015

ActivityManager: Start Intent { act=android.intent.action.MAIN cat=[android.intent.category.HOME]}

I have a app on my android device that runs as a system_process. It's doing USB communication in JNI layer, with a full screen UI to show images. The problem is, the activity becomes invisible not long after start up. I can see from logcat that the onStop() was called. And when I click the app icon the make it foreground, it would disappear again later. I looked into the logcat to find that when this happens, there is a message like: ActivityManager: Start Intent { act=android.intent.action.MAIN cat=[android.intent.category.HOME]} I don't know whether this means the home key is pressed. Actually I was not pressing that. But this indeed makes my app goes background and the home page was showed. I try to add "android.intent.category.HOME" in my AndroidManifest.xml. It does not work.

My question is, what triggers ActivityManager to "Start Intent { act=android.intent.action.MAIN cat=[android.intent.category.HOME]}" ? It seems the event is raise at random time. Can I capture & ignore this event to prevent my app from becoming invisible ?

By the way, my device has android 4.1.2 version.

Aucun commentaire:

Enregistrer un commentaire