Android Question Mystery view

RB Smissaert

Well-Known Member
Licensed User
Longtime User
Despite giving a tag to all the views in my project (including Activity) I can see there is still one view
with a Null tag. Can't figure out what this view is. I can reproduce this easily for example take this project:
https://www.b4x.com/android/forum/threads/b4x-xui-b4xdialog-custom-dialogs.99756/
and give all views a tag the same as the view name and do in Public Sub Show:

B4X:
 For Each v As B4XView In Background.GetAllViewsRecursive
  v.Enabled = False
  Log("Dialog.Show, vTag: " & v.Tag)
 Next

Then we get:

Dialog.Show, vTag: iv
Dialog.Show, vTag: Base
Dialog.Show, vTag: -3
Dialog.Show, vTag: -1
Dialog.Show, vTag: null
Dialog.Show, vTag: txtFirstName
Dialog.Show, vTag: txtLastName
Dialog.Show, vTag: Label1
Dialog.Show, vTag: Label2

So, what is the view here with the null Tag?

RBS
 

Sandman

Expert
Licensed User
I can think of several ways of finding the null view, but how about this for starters? (And let's hope it's actually on-screen.)

B4X:
For Each v As B4XView In Background.GetAllViewsRecursive
  v.Enabled = (v.Tag = Null)
  Log("Dialog.Show, vTag: " & v.Tag)
 Next
 
Upvote 0

RB Smissaert

Well-Known Member
Licensed User
Longtime User
I can think of several ways of finding the null view, but how about this for starters? (And let's hope it's actually on-screen.)

B4X:
For Each v As B4XView In Background.GetAllViewsRecursive
  v.Enabled = (v.Tag = Null)
  Log("Dialog.Show, vTag: " & v.Tag)
 Next

I tried that, but it gives me exactly the same log output.
Did you try the quoted example?

RBS
 
Upvote 0

Sandman

Expert
Licensed User
Well, with my example you shouldn't look at the log. Look at your screen, the Null view should be the only one visible. (Try setting the X and Y pos of it to be on-screen if needed.)
 
Upvote 0

Star-Dust

Expert
Licensed User
If you want to see what kind of view it is and where it is you do it

B4X:
For Each v As View In Background.GetAllViewsRecursive
  Log("________")
  Log("Tag: " & v.Tag)
  Log("Type Class: " & v)
  Log("Top: " & v.Top)
  Log("Left: " & v.Left)
Next
 
Upvote 0

RB Smissaert

Well-Known Member
Licensed User
Longtime User
If you want to see what kind of view it is and where it is you do it

B4X:
For Each v As View In Background.GetAllViewsRecursive
  Log("________")
  Log("Tag: " & v.Tag)
  Log("Type Class: " & v)
  Log("Top: " & v.Top)
  Log("Left: " & v.Left)
Next

Yes, can see that in the quoted example it was the panel called p, which I hadn't given a tag.
Mystery solved.

RBS
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
This may be a wild guess, but, can it be that the null view is the "parent" of all the others, like in B4J, the "Form" is not the parent, the rootpane is... So this null view may be the activity panel...
 
Upvote 0

RB Smissaert

Well-Known Member
Licensed User
Longtime User
This may be a wild guess, but, can it be that the null view is the "parent" of all the others, like in B4J, the "Form" is not the parent, the rootpane is... So this null view may be the activity panel...

In the quoted example it was the panel called p, which I forgot to give a Tag.
BTW, it looks that in the quoted example we could do away with the panel called Base.
Will have a look at that.

RBS
 
Upvote 0
Top