简体   繁体   中英

Cannot instantiate the type HttpConnection

the following is a part of my android java code, I am getting the error "Cannot instantiate the type HttpConnection"

import org.apache.http.HttpConnection;
import android.app.Activity;
import android.app.AlertDialog;


public class MainActivity_test extends Activity 
{
   int resultcode,flag;    
   public static final int DIALOG_LOADING_PROGRESS = 0;
   HttpConnection con;
con = new HttpConnection();
.
.
.
}

HttpConnection是一个接口,因此您无法从中构造对象。

org.apache.http.HttpConnection is a interface, so you cannot create object out of it. See the API

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM