logcat error in Android populate spinner from mysql database

sir
hi i am using android ecllipse for development of android app but i am encountering a problem in "Android populate spinner from mysql database" in logcat saying "attempted to finish an input event receiver has already been disposed"

Help me

Kush


public class Admin_ViewCollege extends Activity {

ArrayList listItems=new ArrayList();
   ArrayAdapter adapter;

Spinner sp;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_admin__view_college);

sp=(Spinner)findViewById(R.id.spinner);
    adapter=new ArrayAdapter(this,R.layout.spinner_layout,R.id.txt,listItems);
    sp.setAdapter(adapter);
    
}
public void onStart(){
    super.onStart();
    BackTask bt=new BackTask();
    bt.execute();
  }


private class BackTask extends AsyncTask {
    ArrayList list;
    protected void onPreExecute(){
     super.onPreExecute();
     list=new ArrayList();
    }
    protected Void doInBackground(Void...params){
     InputStream is=null;
     String result="";
     try{
       HttpClient httpclient=new DefaultHttpClient();
       HttpPost httppost= new HttpPost("http://10.0.2.2:8080/pagal/admin_populating_college.php");
       HttpResponse response=httpclient.execute(httppost);
       HttpEntity entity = response.getEntity();
       // Get our response as a String.
       is = entity.getContent();
     }catch(IOException e){
       e.printStackTrace();
     }

     //convert response to string
     try{
       BufferedReader reader = new BufferedReader(new InputStreamReader(is,"utf-8"));      
       String line = null;
       while ((line = reader.readLine()) != null) {
         result+=line;
       }
      
       //result=sb.toString();
     }catch(Exception e){
       e.printStackTrace();
     }
     // parse json data
     try{
       JSONArray jArray =new JSONArray(result);
       for(int i=0;i          JSONObject jsonObject=jArray.getJSONObject(i);
         // add interviewee name to arraylist
         list.add(jsonObject.getString("iname"));
       }
     }
     catch(JSONException e){
       e.printStackTrace();
     }
     return null;
    }
    protected void onPostExecute(Void result){
     listItems.addAll(list);
     adapter.notifyDataSetChanged();
    }
  }

Posted by: kush saurav | post date: 12-10-2015 | Subject: Android Apps Development

write programming tip




    This website intents to provide free and high quality tutorials, examples, exercises and solutions, questions and answers of programming and scripting languages:
    C, C++, C#, Java, VB.NET, Python, VBA,PHP & Mysql, SQL, JSP, ASP.NET,HTML, CSS, JQuery, JavaScript and other applications such as MS Excel, MS Access, and MS Word. However, we don't guarantee all things of the web are accurate. If you find any error, please report it then we will take actions to correct it as soon as possible.