I want to get a return value from a function From CLass A in class B. But i do not want to create a new instance of class A in Class B. Since all the variable value in class a are null if i create a new instance. I also cannot use static in the function because i dont get access to non static varible. I have tried using aync task/ handler to but cannot find any way to return value from handle message>
public class ClassA(){
List<String> stringlist;
public List<String> getStringlist() {
//code
return stringlist;
}
}
public class ClassB(){
public void getValueFromCLassA {
ClassA classA = new ClassA();
List<string> string = classA.getStingList();
}
}