Android Question [Solved]Transparent app covers device icons

anOparator

Active Member
Licensed User
Longtime User
I put together an app with a Transparent background that changes the device wallpaper every 2 hours.
It steps thru the List of images but I can't click any Device Screen icons (the Phone OR webBrowser).

In the Service module that updates the wallpaper:
B4X:
Sub Service_Start (StartingIntent As Intent)
   StartServiceAt(Me, DateTime.Now + 10000, True)  ' 2 hours, 10 seconds for testing
   If Starter.gtum = Starter.aWallPicX.Size - 1 Then
       Starter.gtum = 1
       Log("    MAX MAX MAX ")
   Else
       Starter.gtum = Starter.gtum + 1
       Log("   min MJN min MIN")
   End If
   Log("      img # = " & Starter.gtum)
   Log("picture name  = " & Starter.aWallPicX.Get(Starter.gtum))
   CallSubDelayed(Main, "changePicture")    ' get next Img!
   StartServiceAt(Me, DateTime.Now + 10000, True)  ' 2 hours, 10 seconds for testing
   'StartServiceAt(Me, DateTime.Now + 1860000, True)  ' 2 hours, 31 minutes for testing.
   Log(" ")
End Sub
In Main:
B4X:
Sub changePicture
   SetWallPaper(LoadBitmap(Starter.daPaf, Starter.aWallPicX.Get(Starter.gtum))) ' change wallpaper
'CallSubDelayed(Main, "changePicture")
End Sub
What is a correct way to prevent a Transparent app from blocking access to the Device Screen icons, while keeping the app running?
Or what different way to solve this?
Thanks in advance.
 

Attachments

  • can't click device icons.zip
    12.2 KB · Views: 127
Last edited:

anOparator

Active Member
Licensed User
Longtime User
What do you need the transparent activity for? The activity will consume the touch events.
The app covered the screen, I gave app a transparent background and could see the wallpaper changing. I was happy till I realized I couldn't click other stuff.
I'm taking this one step at a time for learning purposes, it sort of works but I can't get at the home screen.
I've tried minimizing the app but Main didn't Resume.
 
Upvote 0

anOparator

Active Member
Licensed User
Longtime User
The last line of SetWallPaper:
B4X:
tmrNoButn_Tick
B4X:
Sub tmrNoButn_Tick
tmrNoButn.Enabled = True
Dim jo As JavaObject
jo.InitializeContext
jo.RunMethod("moveTaskToBack", Array(True))
tmrNoButn.Enabled = False
End Sub
Updates SetWallPaper in 1 second and hides my app, making the screen accessible.
Side note: Am wondering if this should be a widget, would the code from my Main run from a Service module?
 
Last edited:
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
it take less minutes to test it than to get an answer here. Try it
 
Upvote 0

anOparator

Active Member
Licensed User
Longtime User
it take less minutes to test it than to get an answer here. Try it
:) I should have written:
I added a timer routine and now it Updates SetWallPaper in 1 second and hides my app, making the screen accessible.
Now I'm working on the same issue each time Main does a Resume for its 2 hour wallpaper change (I don't want to use a 2 hour timer).
 
Upvote 0
Top