i want to set my Activity full Screen with Title bar , how can i do this ? thanks
In styles.xml:
<resources>
<style name="Theme.FullScreen" parent="@android:style/Theme.Holo">
<item name="android:windowNoTitle">false</item>
<item name="android:windowFullscreen">true</item>
</style>
</resources>
Refer to your custom style in your mainfest:
<activity android:name=".MyActivity" android:theme="@style/Theme.FullScreen"/>
To be truthful I've not tested this combination myself.
This worked for me:
// Remove System bar (and retain title bar)
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
In code it would look like this:
import android.app.Activity;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;
public class ActivityName extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Remove System bar (and retain title bar)
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
// Set your layout
setContentView(R.layout.main);
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With