0

I am stuck combining windowIsFloating with an Activity which should have an ActionBar.

I want to have an Activity which looks like a popup, thats why i am using a theme for it which has:

<item name="android:windowIsFloating">true</item>

but this seems to cause problems, because as soon as it is set i get a java.lang.IllegalStateException: ActionBarImpl can only be used with a compatible window decor layout

What i want to achive is a popup-like view containing an ActionBar, which can reuse my apps themes and styles. Is there a way to acive it or do i have to try to fake the look of an action bar with a custom view? Is any of the free ActionBar implementations suited for this?

r-hold
  • 941
  • 8
  • 30

1 Answers1

1

There is actually a way to achieve this. Basically the solution works around the constraints enforced by the ActionBarView on the styles attribute android:windowIsFloating. The solution is very good described in the following post here on StackOverflow.

Additionally I put together a sample project based on the code found in that particular post for everybody to check out.

Community
  • 1
  • 1
Johan
  • 176
  • 7