robolectric/robolectric — pull request #696 by thorikawa (2013-09-20 04:08:09+00:00)
Title: Fix custom title issue

Noticed that after #659 is merged, `Window.requestWindowFeature(Window.FEATURE_CUSTOM_TITLE)` is not working. When I run the new test case `shouldSetCustomTitle` without fixing the code, the following error happens.

```
shouldSetCustomTitle(org.robolectric.shadows.ActivityTest) Time elapsed: 0.011 sec <<< ERROR!
android.util.AndroidRuntimeException: You cannot combine custom titles with other title features
at com.android.internal.policy.impl.PhoneWindow.requestFeature(PhoneWindow.java:221)
at android.app.Activity.requestWindowFeature(Activity.java:3225)
at org.robolectric.shadows.ActivityTest$CustomTitleActivity.onCreate(ActivityTest.java:837)
at android.app.Activity.performCreate(Activity.java:5008)
at org.fest.reflect.method.Invoker.invoke(Invoker.java:112)
at org.robolectric.util.ActivityController$1.run(ActivityController.java:117)
at org.robolectric.shadows.ShadowLooper.runPaused(ShadowLooper.java:256)
at org.robolectric.util.ActivityController.create(ActivityController.java:111)
at org.robolectric.util.ActivityController.create(ActivityController.java:124)
at org.robolectric.shadows.ActivityTest.create(ActivityTest.java:749)
at org.robolectric.shadows.ActivityTest.setCustomTitle(ActivityTest.java:737)
```

This error is caused because `ActivityController` requests `Window.FEATURE_ACTION_BAR` before `Activity.onCreate()` is performed. I don't think we need to call it here, because default feature is handled by the native `Window` class.