Android Question RemoveAllViews

LucaMs

Expert
Licensed User
Longtime User
RemoveAllViews - It should not eliminate all the view contained, in this case, in the panel?

I have tried with various "DoEvents" after several "Invalidate", the views remain in place!


B4X:
    Panel1.RemoveAllViews
    Panel1.Invalidate
    Activity.Invalidate
    DoEvents

I can use RemoveAt, i know, but...!
 

LucaMs

Expert
Licensed User
Longtime User
Basically I talk to myself.

The canvas are not the problem.

The problem is an Animation that I use on a button that is not part of the panel but of the same activity.

If I remove the animation the views of the panel disappear regularly using RemoveViewAt.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
What exactly doesn't work with RemoveAllViews ?

I have modified your CleanPanel routine like this:
B4X:
Sub CleanPanel
    Log(Panel1.NumberOfViews)
    Panel1.RemoveAllViews
    Log(Panel1.NumberOfViews)
End Sub
With the two Logs you'll see that the number views is 12 before Panel1.RemoveAllViews and 0 after.
So RemoveAllViews works as expected.
 
Last edited:
Upvote 0

mangojack

Expert
Licensed User
Longtime User
Klaus ... the last line of your amended CleanPanel sub .. " Panel1.NumberOfViews-1To0Step -" ... should that be there ?
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User


You are right, Klaus, about the log (also using RemoveAt log is the same), but ... the images remain visible in the panel!

I tried to use Panel1.Invalidate (which, if I'm not mistaken, is the equivalent of Refresh in VB.Net) but it still does not work.

Only excluding the animation (change the comments), the result becomes well
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
ehm...

it works perfectly in that project (it is an example) but not in my app.
I'm searching the difference, or the bug.

I hope it is not because in the example everything is done in the Main and in my app it is in a secondary activity
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…