one of the task of fragment is change ui !!! you must change ui in activity or fragment
you must use interface
. your server class :
public class server {
.
.
.
public void callServer(IServerResponse iResponse){
.
.
.
iResponse.onResponse(//your data such as List or string or json and etc);
}
public interface IServerResponse{
// use parameter type as you want like List or string ,etc..
void onResponse(String data);
}
}
your fragment or activity implement your interface :
public class SomeFragment extends Fragment implements Server.IServerResponse{
....
@Override
public View onCreateView(...){
...
Server server=new Server();
server.callServer(this);
}
@Override
public void IServerResponse(String data){
textview.SetText(data);
}
}