Android Studio Errors

时间:2021-09-26 23:47:44

1.The import org.apache.http.client;

tip: cannot be resolved;

resolve:

add this line in build.gradle android { useLibrary 'org.apache.http.legacy' }

2.Can't create handler inside thread that has not called Looper.prepare()

tip:Can't create handler inside thread that has not called Looper.prepare()

resolve:

new Thread() {

public void run() {

Looper.prepare();

//...

Looper.loop();

}

}.start();