0

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();
.
.
.
}
user1709815
  • 265
  • 1
  • 2
  • 9

2 Answers2

1

HttpConnection is an interface, and hence you cannot construct an object from it.

Raghav Sood
  • 81,899
  • 22
  • 187
  • 195
1

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

Pradeep Simha
  • 17,683
  • 18
  • 56
  • 107