I hid my notification bar and title bar using below code. But Now, I want to create this notification bar and title bar in response to touch. If I touch my emulator screen, I want to show my notification and title bar after automatically hiding them when I touched that time only I need this notification and title bar that’s all.
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
This is my xml file…..
main.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
xmlns:android="http://schemas.android.com/apk/res/android">
<Gallery xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/videoGrdVw"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:spacing="60px"
android:background="@drawable/bk1"
/>
<LinearLayout
android:layout_height="100px"
android:id="@+id/Header"
android:background="@drawable/images1"
android:orientation="horizontal"
android:layout_alignParentTop="true"
android:layout_width="match_parent">
</LinearLayout>
<LinearLayout
android:layout_height="100px"
android:layout_width="fill_parent"
android:background="@drawable/images2"
android:id="@+id/Footer"
android:orientation="horizontal"
android:layout_alignParentBottom="true"
>
</LinearLayout>
</RelativeLayout>
You need to create an onTouchListener on your main layout element.
This will:
Something like this would work: