There could be two solutions to this.
Solution 1
Using data from Activity during object creation like this.
Create a constructor in the class that could take the desired data like this
public class complaintAdapter{
private String _value;
public complaintAdapter(String value){
_value = value;
// use _value
}
}
This can be used in the activity like this.
Create a method in the class and call it using the data as a parameter.
String value = "hello";
complaintAdapter complaintAdapterObj = new complaintAdapter(value);
Solution 2
Using data from the activity in the method call like this.
Create a method in the class and call it using the data as a parameter.
public class complaintAdapter{
private String _value;
public void sendData(String value){
_value = value;
// use _value
}
}
This can be used in the activity like this
String value = "hello";
complaintAdapter complaintAdapterObj = new complaintAdapter();
complaintAdapterObj.sendData(value);