Android Question [SOLVED] Reload layout file

Sandman

Expert
Licensed User
Longtime User
In case answer by Erel didn't describe your situation, I have a different need:

Sometimes I rename views in my layout, and the class doesn't pick up on that. I solve that by inserting a character into the LoadLayout parameter, wait a second, and then delete said character. That will make the IDE reload the layout and correctly find my variables. (This wasn't all that well explained - let me know if I need to clarify.)
 
Upvote 0

makis_best

Well-Known Member
Licensed User
Longtime User
In case answer by Erel didn't describe your situation, I have a different need:

Sometimes I rename views in my layout, and the class doesn't pick up on that. I solve that by inserting a character into the LoadLayout parameter, wait a second, and then delete said character. That will make the IDE reload the layout and correctly find my variables. (This wasn't all that well explained - let me know if I need to clarify.)

Dear @Sandman

I really didn't get what you mean.
Is there any simple example?
 
Upvote 0

Sandman

Expert
Licensed User
Longtime User
I really didn't get what you mean.
Is there any simple example?
Does this clarify?

The situation is that a name of a view in a layout and the actual code can match perfectly, but the IDE hasn't realized it. So it underlines the dimmed variable with red in the code and give the error message "Variable 'viewNameHere' was not initialized (warning #11)".

The solution I use often is to find the LoadLayout line in the code, insert a character somewhere (making the IDE try to load the layout with the broken name - and fail, turning lots of things red in the code), and after a second remove the added character (making the IDE try to load the layout with the correct name - and succeed). At this point the IDE matches the views name from the layout to what I have in the code.

Sorry, I don't know how to better explain this. If you never have problems with Warning #11, relating to views from layouts this is probably something that you can safely ignore. :)
 
Upvote 0

makis_best

Well-Known Member
Licensed User
Longtime User
I haven't use custolistview for much.
Now I start using them more and more.
I understand what you mean.
That's a tick to force IDE to bring forward the layout.
Thanks.. I will try.
 
Upvote 0
Top