Heim > Fragen und Antworten > Hauptteil
链接里有“[”或者“]”应用就会闪退,求解决方法....
源码:
OkHttpClient o=new OkHttpClient();
Request r=new Request.Builder().url("XXXXXXXX").build();
o.newCall(r).enqueue(new Callback()
{
@Override
public void onFailure(Request p1, IOException p2)
{
runOnUiThread(new Runnable()
{
@Override
public void run()
{
}
});
}
@Override
public void onResponse(final Response p1) throws IOException
{
final String res=p1.body().string();
runOnUiThread(new Runnable()
{
@Override
public void run()
{
t.setText(res);
}
});
}
});