My question is how do I pass variables between classes which both the classes extends Activity
, yes I have 2 main classes
for example, I have a object class that has all the setters and getters which is then put in an ArrayList<object>
, but when I set the variables in classA extends Activity
and I want to pass the variables that I set for object class in classA
so that I can get them in classB
extends Activity
I tired just doing this in classB
ArrayList<object> objArrayList;
objArrayList.get(pos).getName;
But all I come back with is a null pointer.
I also did a Log.d("test", "name: " + objArrayList.get(pos).getName);
in classA
it works fine but when I do this in classB
, I get a nullpointer