I have an activity where I grab a textview normallythen I have a separate class thats needs that textview to modify it
//textview
this.tvUpdate = (TextView) findViewById(R.id.tvUpdate);
new GetData(context,params,method,preText);
I want to get this same view in a seperate class without having to pass it in the constructor.
public class GetData {
private ProgressBar pbTitle;
private TextView tvUpdate;
private Context context;
private String preText,method;
private String[] params;
public void getData(Context context,String[] params, String method,String preText){
this.context = context;
//how do i get this text view?
this.tvUpdate = ???
this.params = params;
this.method = method;
}
}
not sure if this is possible.
Edit working line of code
tvUpdate = (TextView) ((Activity) context).findViewById(R.id.tvUpdate);
this might work.