Question

I have a tabactivity with several tabs. Each tab has an ActivityGroup associated with it, and uses a LocalActivityManager to handle local activity stacks. This all seems to be working properly although I have not done any extensive debugging on it yet.

A few of my activities need to open windows which don't have the tabactivity widget at the top. This seemed straight forward enough to me and I called it like any other Activity:

Intent i = new Intent(this, ActivityLeaveTabs.class);
startActivity(i);  

Everything seems to work just fine to be honest, however every time I leave the tabactivity I am getting the following warning:

couldn't save which view has the focus because the focused view com.android.internal.policy.impl.PhoneWindow$DecorView@43e4a3888 has no id

I should mention that I am sending this intent out from one of the activities which is part of an Activitygroup which itself represents one of the tabs from the tabactivity. I suspect the problem is stemming from calling "startActivity(this,..." from there, but I tried a bunch of variations using getParent() which did not help.

I am not exactly clear on what the warning means or if it is actually a problem. Any help resolving the warning or if anyone can tell me not to worry about it (the program seems to be working just fine) would be much appreciated!

Was it helpful?

Solution

It sounds like it has something to do with saving focus as a new activity comes to the front.

This sheds a little light on the issue; the DecorView contains all the other views in your activity. There is not usually a reason for it to have an id (although you might be able to set one programmatically). Since it's not a big deal whether or not the background has focus, I think you can safely ignore this warning.

An interesting test would be to try to launch your next activity via a button's onClick or something else that would require having another view gain focus and then seeing if you still get the warning.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top