Android:Listview onClick not working properly?
<p>Hi 
         I have Listview whose data coming from  website.data Displays properly in a Listview but its onListItemClick not firing properly.... pleas help me.</p>

<pre><code>public class OutKrys extends ListActivity   {
private ProgressDialog progress;
ListView listView1;
private ArrayList&lt;Post&gt; listItems = new ArrayList&lt;Post&gt;();
private PostAdapter post_Adapter;
public static DefaultHttpClient httpclient = new DefaultHttpClient();
private class PostAdapter extends ArrayAdapter&lt;Post&gt; {

    private ArrayList&lt;Post&gt; items = new ArrayList&lt;Post&gt;();

    public PostAdapter(Context context, int textViewResourceId,
            ArrayList&lt;Post&gt; items) {
        super(context, textViewResourceId, items);
        this.items = items;
    }

     @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        try {
            View v = convertView;
            if (v == null) {
                LayoutInflater vi = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
                v = vi.inflate(R.layout.outkrys, null);
            }
            Post o = items.get(position);
            if (o != null) {
                TextView tt = (TextView) v.findViewById(R.id.Story);
                TextView bt = (TextView) v.findViewById(R.id.userName);
                TextView tm = (TextView) v.findViewById(R.id.Time);
                ImageView iv=(ImageView)v.findViewById(R.id.OutKryImageView01);
                if (tt != null) {
                    tt.setText(o.getStory());
                }
                if (bt != null) {
                    bt.setText(o.getUserName());
                }
                if (tm != null) {
                    tm.setText(o.getTime());
                    if(iv!=null)
                    {
                          Drawable drawable = LoadImageFromWebOperations("abc.com/"+o.getImagePath());
                            iv.setImageDrawable(drawable);

                    }

                }
            }
            return v;
        } catch (Exception e) {
            progress.dismiss();
            return null;
        }
    }
}
private Drawable LoadImageFromWebOperations(String url)

{
    try
    {

        InputStream is = (InputStream) new URL(url).getContent();
        Drawable d = Drawable.createFromStream(is, "src name");
        return d;
    }catch (Exception e) {
        System.out.println("Exc="+e);
        return null;
    }
}
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
    super.onListItemClick(l, v, position, id);
    // Get the item that was clicked
    Object o = this.getListAdapter().getItem(position);
    String keyword = o.toString();
    Toast.makeText(this, "You selected: " + position, Toast.LENGTH_LONG)
            .show();

}
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    //setContentView(R.layout.listitems);
    //listView1 = (ListView) findViewById(R.id.ListView01);
    try {
        progress = ProgressDialog.show(OutKrys.this, "Please wait...",
                "Loading list", true);
        Thread t = new Thread() {
            public void run() {
                listItems=getList();
                pHandler.post(mUpdateResults);
            }
            };
        t.start();



    } catch (Exception e) {
        //progress.dismiss();
        Toast.makeText(OutKrys.this, "dsadsadsa"+e, Toast.LENGTH_LONG).show();
    }
}
final Handler pHandler = new Handler();

// Create runnable for posting
final Runnable mUpdateResults = new Runnable() {
    public void run() {

        updateTabData();


    }
};
private void updateTabData() {
    try {

        this.post_Adapter = new PostAdapter(this, android.R.layout.simple_list_item_checked,
                listItems);
        this.setListAdapter( new PostAdapter(this, R.layout.outkrys,
                listItems));

        progress.dismiss();






    } catch (Exception e) {
        //progress.dismiss();

    }
}


private ArrayList&lt;Post&gt; getList() {
    try {

        String loginURI = "abcd.com";
        HttpPost httpost = new HttpPost(loginURI);
        List&lt;NameValuePair&gt; nvps = new ArrayList&lt;NameValuePair&gt;();
        nvps.add(new BasicNameValuePair("authenticate", "authenticate"));
        nvps.add(new BasicNameValuePair("tab", "Recent"));
        httpost.setEntity(new UrlEncodedFormEntity(nvps, HTTP.UTF_8));
        HttpResponse response = null;
        response = KryAbout.httpclient.execute(httpost);
        HttpEntity entity = response.getEntity();

        Post p = new Post();
        String line = "";
        if (entity != null) {
            InputStream resContent = response.getEntity().getContent();
            line = KryAbout.ReadInputStream(resContent).toString().trim();
        } else {
        }
        listItems.removeAll(listItems);
        JSONArray ja = new JSONArray(line);
        for (int i = 0; i &lt; ja.length(); i++) {
            p = new Post();
            JSONObject jo = (JSONObject) ja.get(i);
            p.setStory(jo.getString("story"));
            p.setFavorite(false);
            p.setTime(jo.getString("time"));
            p.setPid(Integer.parseInt(jo.getString("pid")));
            p.setUserName(jo.getString("username"));
            p.setImagePath(jo.getString("profilepicture"));
            listItems.add(p);
        }
    } catch (Exception e) {
        progress.dismiss();
    }
    return listItems;
}



    }
</code></pre>
