I am getting ArrayIndexOutOfBoundsException in code kindly help where is the issue.
and how to resolve that issue
Here is code for my activity:

```
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    this.textview = (TextView) findViewById(R.id.textView1);

    // HTTPConnector http = new HTTPConnector();
    GetAllDataTask get = new GetAllDataTask();
    get.execute();
}

public void setTextToTextView(JSONArray jsonArray) {

    String s = "";
    for (int i = 0; i < jsonArray.length(); i++) {

        JSONObject json = null;
        try {
            json = jsonArray.getJSONObject(i);

            s = s + "\n" + "Name =" + json.getString("name") + "\n"
                    + "Contact number = " + json.getInt("contact") + "\n"
                    + "Categroy = " + json.getString("Category");
        } catch (JSONException e) {
            Toast.makeText(getApplicationContext(),
                    "there is some problem", Toast.LENGTH_SHORT).show();
            e.printStackTrace();
        }
    }
    this.textview.setText(s);
}

private class GetAllDataTask extends
        AsyncTask<HTTPConnector, Long, JSONArray> {

    @Override
    protected JSONArray doInBackground(HTTPConnector... arg0) {
        // TODO Auto-generated method stub
        return arg0[0].GetAllData();
    }

    @Override
    protected void onPostExecute(JSONArray jsonArray) {
        // TODO Auto-generated method stub
        setTextToTextView(jsonArray);
    }

}

```

Here is some part of stack trace I'm getting from this issue:

```
07-24 14:27:36.059: E/AndroidRuntime_2_crash(27865): crash in the same process: 
07-24 14:27:36.059: E/AndroidRuntime_2_crash(27865): java.lang.RuntimeException: An error occured while executing doInBackground()
07-24 14:27:36.059: E/AndroidRuntime_2_crash(27865):    at android.os.AsyncTask$3.done(AsyncTask.java:278)
07-24 14:27:36.059: E/AndroidRuntime_2_crash(27865): Caused by: java.lang.ArrayIndexOutOfBoundsException: length=0; index=0

```