android linkify in listview
<p>I have this code:</p>

<pre><code>import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.apache.http.NameValuePair;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import com.romantic.aacplay.R;
import android.app.ListActivity;
import android.app.ProgressDialog;
import android.graphics.Color;
import android.graphics.drawable.GradientDrawable;
import android.os.AsyncTask;
import android.os.Bundle;
// import android.text.Html;
// import android.text.Html;
import android.text.Html;
import android.util.Log;
import android.view.View;
import android.widget.ListAdapter;
import android.widget.SimpleAdapter;


public class PodCast extends ListActivity {
        private ProgressDialog pDialog;


        JSONParser jParser = new JSONParser();

        ArrayList&lt;HashMap&lt;String, String&gt;&gt; productsList;

        private static String url_all_products = "http://mysite.net/andro/pcast.php";
        private static final String TAG_SUCCESS = "success";
        private static final String TAG_PRODUCTS = "podcast";
        private static final String TAG_LINK = "link";
        private static final String TAG_NAME = "nume";

        JSONArray products = null;

        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.poadcast);

             GradientDrawable gd = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, new int[] {Color.RED,Color.BLACK});
                View title = getWindow().findViewById(android.R.id.title);
                View titleBar = (View) title.getParent();
                titleBar.setBackgroundDrawable(gd);


            productsList = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();

            new LoadAllProducts().execute();

        }

        class LoadAllProducts extends AsyncTask&lt;String, String, String&gt; {
            @Override
            protected void onPreExecute() {
                super.onPreExecute();
                pDialog = new ProgressDialog(PodCast.this);
                pDialog.setMessage("Se incarca. Asteapta...");
                pDialog.setIndeterminate(false);
                pDialog.setCancelable(false);
                pDialog.show();

            }

            protected String doInBackground(String... args) {

                List&lt;NameValuePair&gt; params = new ArrayList&lt;NameValuePair&gt;();
                JSONObject json = jParser.makeHttpRequest(url_all_products, "GET", params);


                Log.d("Ultimele 10 piese: ", json.toString());

                try {
                    int success = json.getInt(TAG_SUCCESS);

                    if (success == 1) {
                        products = json.getJSONArray(TAG_PRODUCTS);
                        for (int i = 0; i &lt; products.length(); i++) {
                            JSONObject c = products.getJSONObject(i);
                            String link = c.getString(TAG_LINK);
                            String name = c.getString(TAG_NAME);
                            HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();
                            // String href = String.format("&lt;a href=\"%s\"&gt; %s &lt;/a&gt;", link, name);
                            // String cici = Html.fromHtml(href).toString();
                            map.put(TAG_NAME, name);
                            map.put(TAG_LINK, "" + Html.fromHtml(link));
                            // map.put(TAG_LINK, link);
                            productsList.add(map);
                        }
                    } else {

                    }
                } catch (JSONException e) {
                    e.printStackTrace();
                }

                return null;
            }

            protected void onPostExecute(String file_url) {

                pDialog.dismiss();
                runOnUiThread(new Runnable() {
                    public void run() {
                        ListAdapter adapter = new SimpleAdapter(
                                PodCast.this, productsList,
                                R.layout.list_item, new String[] {
                                        TAG_NAME, TAG_LINK },
                                new int[] { R.id.link, R.id.name });

                        setListAdapter(adapter);
                    }
                });

            }

        }

}
</code></pre>

<p>Now i'm trying to figure out how can i make the links in listview clickable. I`m trying to linkify a textview that is in found here: </p>

<pre><code>protected void onPostExecute(String file_url) {

                pDialog.dismiss();
                runOnUiThread(new Runnable() {
                    public void run() {
                        ListAdapter adapter = new SimpleAdapter(
                                PodCast.this, productsList,
                                R.layout.list_item, new String[] {
                                        TAG_NAME, TAG_LINK },
                                new int[] { R.id.link, R.id.name });

                        setListAdapter(adapter);
                    }
                });

            }
</code></pre>

<p>R.layout.list_item which is a different .xml layout for the listview.
So can you guys help me solve this? Thanks in advance!</p>
