Android Question Array of Objects - Problem [SOLVED]

wonder

Expert
Licensed User
Longtime User
Hey guys!!
I really need your help! :confused:

I'm experiencing exactly the same problem as mentioned in the link below.
http://stackoverflow.com/questions/4898578/object-array-assignment-problem

Capture.png


The problem is, I don't know how to apply the solution they provide.
It's because your variables are static i.e. they belong to the class, rather than to an instance. Take a look at Java Tutorials | Understanding Instance and Class Members for more information about what this means.
You should remove the static keyword, so that they become instance variables.
There is no static keyword in B4X, right? Can this be solved with Reflection / JavaObject?
 

JordiCP

Expert
Licensed User
Longtime User
If your class is declared in Java, just remove the "static" keyword in your class members.
 
Last edited:
Upvote 0

Roycefer

Well-Known Member
Licensed User
Longtime User
You should post your own B4X code that is causing the problem. Or at least a small snippet that produces the same problem.
 
Upvote 0

wonder

Expert
Licensed User
Longtime User
You should post your own B4X code that is causing the problem. Or at least a small snippet that produces the same problem.
Sure, the original code contains a medium-size class file, collision detection and physics. I'll try to simplify it down to the heart of the problem and post it here.
 
Upvote 0
Top