I have created a Thread in Android IDK why it says invalid return type!
All I want is to display the json
I get from Profile
I want to change the text in my fragment
Thread thread= new Thread(){
if (getActivity()!=null)
{
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
Profile profile = service.getProfile(text);
Gson gson = new Gson();
String json = gson.toJson(profile);
output.setText(json.toString());
}
});
}
};
thread.start();
Try this