How to remove title bar using surface view for adding camera overlay in android

1.2k views Asked by At

I followed this link to create camera overlay with an image. But my problem is I can't remove the title bar using the following codes in onCreate() method:

requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);

It causes probably for the below's code in onCreate method:

getWindow().setFormat(PixelFormat.UNKNOWN);

Now, what can I do and why this is happening? Can anybody explain??

2

There are 2 answers

1
ravi On BEST ANSWER

Use this under the activity tag in manifest file.

 android:theme="@android:style/Theme.NoTitleBar"
1
Bette Devine On

Use following property in your manifest file for the camera activity

<activity android:name="youractivityname"
android:theme="@android:style/Theme.DeviceDefault.NoActionBar.Fullscreen"/>