我在 Android IDK 中创建了一个线程,为什么它说返回类型无效!我想要的只是显示json
我Profile
想要更改片段中的文本
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();