Skip to content

Snappy1

  • Home
  • Android
  • What
  • How
  • Is
  • Can
  • Does
  • Do
  • Why
  • Are
  • Who
  • Toggle search form

[FIXED] Unable to click the below overlay on Android 12

Posted on November 11, 2022 By

Solution 1 :

Set alpha to window manager params, its works for me.

Try below snippet code:

if (Build.VERSION.SDK_INT >= 31) 
{
    params.alpha = 0.8f;
}

Problem :

I have an App on the play store. This app basically creates an overlay on top of all the apps with some colors, It works perfectly for anything below Android 12. But, since Android 12 it no longer works. I can still interact with my application, but once minimized I no longer can click on anything or change anything at all. I have to restart the device to close the application.

  val params = WindowManager.LayoutParams(
            WindowManager.LayoutParams.MATCH_PARENT,
            WindowManager.LayoutParams.MATCH_PARENT,
            if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O)
                WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY
            else WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY,
            WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE
                    or WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
                    or WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS
                    or WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN,
            PixelFormat.TRANSLUCENT
        )

This is how I create the overlay on top. I checked the documentation, but could not find any information. I will be grateful if I can get any help and suggestions to fix this issue.

Comments

Comment posted by medium.com/androiddevelopers/…

This is part of the untrusted touch events in Android. Blog post:

READ  [FIXED] android - How to customize displayed notification when received via FCM?
Powered by Inline Related Posts
Android Tags:android, android-12, foreground-service, overlay

Post navigation

Previous Post: [FIXED] android developer api – there is a ‘Late Initialization Error’ during flutter development
Next Post: [FIXED] android – How to set SSL pinning using retrofit for Firebase Realtime Database Url?

Related Posts

[FIXED] android – prevent multiple checks from being selected in recycleview kotlin Android
[FIXED] java – Android:How do I display data from multiple array of strings in a local JSON file? Android
[FIXED] android – How do I hide Material Bottom App Bar when Coordinator Layout’s child fragment is scrolled? Android
[FIXED] xamarin.forms – Xamarin Forms where to change StatusBar For Android and IOS Android
[FIXED] How to send a data from listview screen to form screen using flutter Android
[FIXED] How can I start a new activity in a coroutine? Kotlin Android Android

Archives

  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022

Categories

  • ¿Cómo
  • ¿Cuál
  • ¿Cuándo
  • ¿Cuántas
  • ¿Cuánto
  • ¿Qué
  • Android
  • Are
  • At
  • C'est
  • Can
  • Comment
  • Did
  • Do
  • Does
  • Est-ce
  • Est-il
  • For
  • Has
  • Hat
  • How
  • In
  • Is
  • Ist
  • Kann
  • Où
  • Pourquoi
  • Quand
  • Quel
  • Quelle
  • Quelles
  • Quels
  • Qui
  • Should
  • Sind
  • Sollte
  • Uncategorized
  • Wann
  • Warum
  • Was
  • Welche
  • Welchen
  • Welcher
  • Welches
  • Were
  • What
  • What's
  • When
  • Where
  • Which
  • Who
  • Who's
  • Why
  • Wie
  • Will
  • Wird
  • Wo
  • Woher
  • you can create a selvedge edge: You can make the edges of garter stitch more smooth by slipping the first stitch of every row.2022-02-04
  • you really only need to know two patterns: garter stitch

Recent Posts

  • Can VPN be traced by police?
  • Where were Kaiser-Frazer cars built?
  • How do you make gold rose gold paint?
  • What are the newest type of dentures?
  • Can you wear joggers as dress pants?

Recent Comments

No comments to show.

Copyright © 2023 Snappy1.

Powered by PressBook Grid Dark theme