1

I've applied this style as below

<style name="MyTheme.Base" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="android:windowNoTitle">true</item>
    <item name="android:windowFullscreen">false</item>
    <item name="android:windowContentOverlay">@null</item>
    <item name="android:windowActionBar">false</item>
    <item name="windowActionBar">false</item>
    <item name="android:windowTitleSize">0dp</item>

...

when i run the application at the first time the title bar is not showing but when i want to write in editbox (when editbox focus) part of the title bar appears

note I've tried to use full screen style and it was working perfectly BUT i want the action bar to be there

Check Images below

Before https://i.stack.imgur.com/l9Wrf.png

After https://i.stack.imgur.com/VeOHH.png

Ra'ad
  • 11
  • 2

2 Answers2

0

Might solve your problem, use this code in onCreate() method and check :

@Override
 protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  this.requestWindowFeature(Window.FEATURE_NO_TITLE); // Add this line
  setContentView(R.layout.YouActivityName);
  .
  .
  //whatever code you have here
 }
Pankaj
  • 7,908
  • 6
  • 42
  • 65
  • I checked this but unfortunately i'm getting this error Process: fridayfair.com, PID: 6121 java.lang.RuntimeException: Unable to start activity ComponentInfo{********.activity.Main}: android.util.AndroidRuntimeException: requestFeature() must be called before adding content at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2411) – Ra'ad Jun 07 '15 at 20:30
0

it was really hard to solve it after trying all possible suggested solutions,

eventually the solution is to do the following

modify my minifist to with the following code

        android:name=".activity.Main"
          android:windowSoftInputMode="stateVisible|adjustPan"
Ra'ad
  • 11
  • 2