Hi stackoverflow
I\'m trying to develop an application with a base activity and a Transparent
activity, so far I\'m able to create a Activity
Add these lines in the Transparent Activity above super.onCreate()
method.
getWindow().setFlags(LayoutParams.FLAG_NOT_TOUCH_MODAL,
LayoutParams.FLAG_NOT_TOUCH_MODAL);
// ...but notify us that it happened.
getWindow().setFlags(LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH,
LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH);
transparent layout like this..
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="8dp" >
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="29dp"
android:layout_marginRight="44dp"
android:text="Button" />
You can use this code on your foreground activity
getWindow().addFlags(
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
| WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL
| WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE);