Android Question DoEvents not work in Android TV

CyclopDroid

Well-Known Member
Licensed User
Longtime User
For pause the change of my card, I use a Doevent into sub:


B4X:
Sub attesa(sec As Double)
  Dim Ti As Long
  Ti = DateTime.Now + (sec * 1000) '1000=1 Secondo
  Do While DateTime.Now < Ti
        DoEvents
  Loop
End Sub

I Call this sub whit example:

B4X:
....
For nCarta=0 To 4
 If CardChange(k)=1 then
   imgCard(nCarta).Enabled=False
   imgCard(nCarta).Bitmap=LoadBitmap(File.DirAssets,ListaCarte.get(nCarta)  & ".png")
   attesa(.3)
   ListaCarte.Set(k,ListaCarte.get(k+Cambio))
   CardChange(k)=0
  End If
Next
....

In the smartphone it' work but into Android TV it's wrong and exit program.
If I delete DoEvents, dont exit but the image not refresh.
The DoEvents have a problem with Android TV.
How can I change this sub to make sure that you do the same and refresh the page and the pictures?
Thanks
 
Last edited:

CyclopDroid

Well-Known Member
Licensed User
Longtime User
The problem is that using a timer, the codes inside the SUB continue without putting paused. I using this sub in other parts and not stopped.
 
Upvote 0

CyclopDroid

Well-Known Member
Licensed User
Longtime User
Unfortunately, the game is already finish and it works perfectly on smartphones (I have not tried it on Android 4.4) .. the problem is that, because of that Sub, not only works on Android TV. Change all require a long time and know if it would work on.
If we not only alternatives to modify this DoEvents think that's the only way to change everything ... or not to publish it on TV. :(
 
Upvote 0
Top