Transparent Activity with background activity click through behaviour in android

后端 未结 2 1487
星月不相逢
星月不相逢 2021-01-02 12:08

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

2条回答
  •  青春惊慌失措
    2021-01-02 12:22

    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..

    
    
    

提交回复
热议问题