Linkview in listview android
<p>I am trying to display url in listview and when user click on url it should open in browser, my code is</p>

<pre><code>package com.app.adapter;

import com.app.myTracker.UI.R;
import com.app.utils.Logger;

import android.content.Context;
import android.text.Html;
import android.text.method.LinkMovementMethod;
import android.text.method.MovementMethod;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

public class BrowserLogListAdapter extends BaseAdapter{
    String []VISIT,DATE,URL;
    int []ID;
    Context c;
    private LayoutInflater mInflater;

    static class ViewHolder {
        TextView url;
        TextView visit;
        TextView date;
        ImageView imgIcon;
    }

    public BrowserLogListAdapter(Context context,int[]id, String[]visit, String[]date,String []url){
        c=context;
        mInflater = LayoutInflater.from(context);
        ID = id;
        VISIT = visit;
        DATE = date;
        URL = url;
    }

    public int getCount() {
        // TODO Auto-generated method stub
        return ID.length;
    }

    public Object getItem(int position) {
        // TODO Auto-generated method stub
        return position;
    }

    public long getItemId(int position) {
        // TODO Auto-generated method stub
        return position;
    }

    public View getView(int position, View convertView, ViewGroup parent) {
        // TODO Auto-generated method stub
        ViewHolder holder;
        if (convertView == null) 
        {
           convertView = mInflater.inflate(R.layout.browser_log_list_item, null);
           holder = new ViewHolder();
         //  holder.visit = (TextView) convertView.findViewById(R.id.txt_visit);
           holder.date = (TextView)convertView.findViewById(R.id.txt_time);
           holder.url = (TextView)convertView.findViewById(R.id.txtURL);
           convertView.setTag(holder);
        } 
        else 
            holder = (ViewHolder) convertView.getTag();
        Logger.debug(VISIT[position]);
        //holder.visit.setText(c.getString(R.string.txt_total_visit)+": "+ VISIT[position]);
        String text = "&lt;a href='"+URL[position]+"'&gt;"+URL[position]+"&lt;/a&gt;";
        Logger.debug("text:"+text);
        holder.date.setText(DATE[position]);
        holder.url.setText(Html.fromHtml(text));
        holder.url.setMovementMethod(LinkMovementMethod.getInstance());

        return convertView;
    }
}
</code></pre>

<p>and in activity I am calling this adapter like,</p>

<pre><code>lvlView.setAdapter(new BrowserLogListAdapter(getApplicationContext(), id, visit, time, url));
</code></pre>

<p>so when I am trying to click on url link in list view it shows me error like </p>

<pre><code>05-10 13:59:22.630: ERROR/AndroidRuntime(5709): FATAL EXCEPTION: main
05-10 13:59:22.630: ERROR/AndroidRuntime(5709): android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity  context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
05-10 13:59:22.630: ERROR/AndroidRuntime(5709):     at android.app.ContextImpl.startActivity(ContextImpl.java:617)
05-10 13:59:22.630: ERROR/AndroidRuntime(5709):     at android.content.ContextWrapper.startActivity(ContextWrapper.java:258)
05-10 13:59:22.630: ERROR/AndroidRuntime(5709):     at android.text.style.URLSpan.onClick(URLSpan.java:62)
05-10 13:59:22.630: ERROR/AndroidRuntime(5709):     at android.text.method.LinkMovementMethod.onTouchEvent(LinkMovementMethod.java:216)
05-10 13:59:22.630: ERROR/AndroidRuntime(5709):     at android.widget.TextView.onTouchEvent(TextView.java:6577)
05-10 13:59:22.630: ERROR/AndroidRuntime(5709):     at android.view.View.dispatchTouchEvent(View.java:3766)
05-10 13:59:22.630: ERROR/AndroidRuntime(5709):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
05-10 13:59:22.630: ERROR/AndroidRuntime(5709):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
05-10 13:59:22.630: ERROR/AndroidRuntime(5709):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
05-10 13:59:22.630: ERROR/AndroidRuntime(5709):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
05-10 13:59:22.630: ERROR/AndroidRuntime(5709):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
05-10 13:59:22.630: ERROR/AndroidRuntime(5709):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
05-10 13:59:22.630: ERROR/AndroidRuntime(5709):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1671)
05-10 13:59:22.630: ERROR/AndroidRuntime(5709):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)
05-10 13:59:22.630: ERROR/AndroidRuntime(5709):     at android.app.Activity.dispatchTouchEvent(Activity.java:2086)
05-10 13:59:22.630: ERROR/AndroidRuntime(5709):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1655)
05-10 13:59:22.630: ERROR/AndroidRuntime(5709):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1785)
05-10 13:59:22.630: ERROR/AndroidRuntime(5709):     at android.os.Handler.dispatchMessage(Handler.java:99)
05-10 13:59:22.630: ERROR/AndroidRuntime(5709):     at android.os.Looper.loop(Looper.java:123)
05-10 13:59:22.630: ERROR/AndroidRuntime(5709):     at android.app.ActivityThread.main(ActivityThread.java:4627)
05-10 13:59:22.630: ERROR/AndroidRuntime(5709):     at java.lang.reflect.Method.invokeNative(Native Method)
05-10 13:59:22.630: ERROR/AndroidRuntime(5709):     at java.lang.reflect.Method.invoke(Method.java:521)
05-10 13:59:22.630: ERROR/AndroidRuntime(5709):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
05-10 13:59:22.630: ERROR/AndroidRuntime(5709):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
05-10 13:59:22.630: ERROR/AndroidRuntime(5709):     at dalvik.system.NativeStart.main(Native Method)
</code></pre>

<p>If I use same code for url redirection in simple textview apart from in custom list adapter it works fine, but in list view it shows this error</p>
