Can't update stat BROWSER_SNAP_CENTER illegal argument exception in android
<p>I am getting  Can't update stat BROWSER_SNAP_CENTER  illegal argument exception in android .I am using webview in gesture detector and  activity group manager in android at the time of swipe I am getting error   Can't update stat BROWSER_SNAP_CENTER  illegal argument exception can any body tell what is the problem?</p>

<p>my code </p>

<pre><code>import java.util.ArrayList;
import java.util.HashMap;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.text.Html;
import android.text.Spanned;
import android.util.Log;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
import android.view.ViewGroup.LayoutParams;
import android.webkit.WebView;
import android.widget.LinearLayout;
import android.widget.Toast;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.View;
import android.view.GestureDetector.OnDoubleTapListener;
import android.view.View.OnClickListener;
import android.view.View.OnTouchListener;
public class ArticleDisplayActivity extends Activity 
 {
    private static final String SOAP_ACTION = "http://tempuri.org/QuestIPhoneWebService/QuestIPhoneWebService/getData"; 
    private static final String METHOD_NAME = "getData"; 
    private static final String NAMESPACE ="http://tempuri.org/"; 
    private static String URL="http://10.113.73.61/QUEST/QuestIPhoneWebService.asmx";
    private static final int SWIPE_MIN_DISTANCE = 120;
    private static final int SWIPE_MAX_OFF_PATH = 250;
    private static final int SWIPE_THRESHOLD_VELOCITY = 200;
    private GestureDetector  gestureScanner;    
    String strUsername="";
    String strPassWord="";
    String questGroupId="";
    String articleid="";
    String userid="";
    String systemuserid="";
    String tableservicevalue="";
    String webservicevalue="";
    String checking="";
    ArrayList parsedValue=new ArrayList();
    ArrayList articleDetailParsedValue=new ArrayList();
    ArrayList articleParsedValue=new ArrayList();
     LinearLayout mainlinear2;
     public void onCreate(Bundle savedInstanceState) { 
            super.onCreate(savedInstanceState); 
            setContentView(R.layout.articledisplay); 
            mainlinear2=(LinearLayout)findViewById(R.id.mainlinear2);
            Bundle articleBundle=getIntent().getExtras();
            strUsername=articleBundle.get("strUserName").toString();
             strPassWord=articleBundle.get("strPassWord").toString();
             questGroupId=articleBundle.get("questGroupId").toString();
             userid=articleBundle.getString("userid").toString();
             articleid=articleBundle.get("articleid").toString();
             systemuserid=articleBundle.get("systemuserid").toString();
             checking=articleBundle.get("checking").toString();
             checking="two";
             parsedValue=articleBundle.getStringArrayList("parsedValue");
             articleParsedValue=articleBundle.getStringArrayList("articleParsedValue");
             //parsedValue=articleBundle.get
             //tableservicevalue=articleBundle.get("tableservicevalue").toString();
             //webservicevalue=articleBundle.get("webservicevalue").toString();
            WebService1  articledisplayservice=new WebService1();
             //  String tableservicevalue=tableservice.callTableServer(SOAP_ACTION,"",strUsername,strPassWord,questGroupId,URL);
           String articledisplayservicevalue=articledisplayservice.articleDisplayServer(SOAP_ACTION, "", strUsername, strPassWord, articleid, systemuserid, URL);
           //String articledisplayservicevalue=articledisplayservice.articleDisplayServer(SOAP_ACTION, "", strUsername, strPassWord,questGroupId, URL);


         //articledisplayservicevalue=decodeXMLData(articledisplayservicevalue);
         //System.out.println("article web service decode value is"+articledisplayservicevalue);

                  //Log.d("article  webservice value decode value is ",articledisplayservicevalue);     

            //articledisplayservicevalue=Html.
            articledisplayservicevalue=unescapeXML(articledisplayservicevalue);
        System.out.println("article web service decode value is"+articledisplayservicevalue);
                 // ArticleParser articleParser=new ArticleParser();
                ArticleDetailParser articleDetailParser=new ArticleDetailParser();  
                articleDetailParsedValue=articleDetailParser.parseXmlArticle(articledisplayservicevalue);
            for(int i=0;i&lt;articleDetailParsedValue.size();i++)
                {

                       ArticleDetailDataset articleDetailDataset=(ArticleDetailDataset)articleDetailParsedValue.get(i);
                            HashMap&lt;String, String&gt; mapValue=new HashMap&lt;String, String&gt;();  

                   //WebView webviewcontent=new WebView(this);

                       MyWebView webviewcontent= new MyWebView(this);     
                         //WebView  webviewcontent=(WebView)findViewById(R.id.webview_compontent);     
                    webviewcontent.setId(i);
                   //webviewcontent.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
                  String body=articleDetailDataset.getBody();

                   System.out.println("body1 is "+body);
                       //body=decodeXMLData(body);

                    String html ="&lt;html&gt;&lt;body&gt;&lt;div&gt;&lt;label style=\"font:bold 17.5px verdana; color:#C1002B\"&gt;"+articleDetailDataset.getArticle_title()+"&lt;label style=\"font:13px verdana; color:#000000\"&gt;"+"|"+"&lt;/label&gt;"+"&lt;label style=\"font:bold 13px verdana; color:#000000\"&gt;"+articleDetailDataset.getArticle_type()+"&lt;/label&gt;&lt;br&gt;&lt;label style=\"font:13px verdana; color:#AAAAAA\"&gt; &lt;/label&gt; &lt;/div&gt;";
                   html=html+"&lt;div&gt;&lt;label style=\"font:13px verdana; color:#000000\"&gt;"+body+"&lt;/label&gt;&lt;/div&gt;";
                   html=html+"&lt;div&gt;&lt;label style=\"font:13px verdana; color:#000000\"&gt;"+articleDetailDataset.getArticle_summary()+"&lt;/label&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;" ;
                   webviewcontent.getSettings().setJavaScriptEnabled(true);
                   webviewcontent.clearCache(true);
                   //webviewcontent.loadData(html, "text/html", "utf-8");
                   webviewcontent.loadDataWithBaseURL(null, html, "text/html", "UTF-8", null);
                  //webviewcontent.setOnTouchListener( this);
                    mainlinear2.addView(webviewcontent);

                }  

         }










        public  String unescapeXML(String str) {
            if (str == null || str.length() == 0)
              return "";

            StringBuffer buf = new StringBuffer();
            int len = str.length();
            for (int i = 0; i &lt; len; ++i) {
              char c = str.charAt(i);
              if (c == '&amp;') {
                int pos = str.indexOf(";", i);
                if (pos == -1) { // Really evil
                  buf.append('&amp;');
                } else if (str.charAt(i + 1) == '#') {
                  int val = Integer.parseInt(str.substring(i + 2, pos), 16);
                  buf.append((char) val);
                  i = pos;
                } else {
                  String substr = str.substring(i, pos + 1);
                  if (substr.equals("&amp;amp;"))
                    buf.append('&amp;');
                  else if (substr.equals("&amp;lt;"))
                    buf.append('&lt;');
                  else if (substr.equals("&amp;gt;"))
                    buf.append('&gt;');
                  else if (substr.equals("&amp;quot;"))
                    buf.append('"');
                  else if (substr.equals("&amp;apos;"))
                    buf.append('\'');
                  else if (substr.equals("&amp;nbsp;"))
                      buf.append(" ");

                  else
                    // ????
                    buf.append(substr);
                  i = pos;
                }
              } else {
                buf.append(c);
              }
            }
            return buf.toString();
          }












     public  String decodeXMLData(String s)

     {



           /*s = replace(s,"&amp;gt;","&gt;", 0);
             s = replace(s,"&amp;lt;","&lt;", 0);
             s=replace(s,"&amp;amp;","&amp;",0);
             s=replace(s,"&amp;quot;","\"",0);
             s=replace(s,"&amp;nbsp;"," ",0);
             s=replace(s,"&amp;apos;","'",0);
           */ 
            /*s=replace(s,"&amp;amp;lt;","&lt;",0);
             s=replace(s,"&amp;amp;quot;","\"",0);
             s=replace(s,"&amp;amp;gt;","&gt;",0);
             s=replace(s,"&amp;amp;amp;","&amp;",0);
             */


             s=replace(s,"&amp;amp;lt;","&lt;",0);
             s=replace(s,"&amp;amp;quot;","\"",0);
             s=replace(s,"&amp;amp;gt;","&gt;",0);
             s=replace(s,"&amp;amp;amp;","&amp;",0);
             s=replace(s,"&amp;lt;","&lt;", 0);
             s=replace(s,"&amp;gt;","&gt;", 0);
             s=replace(s,"&amp;lt;a href","&amp;", 0);
             s=replace(s,"/a&amp;gt","&amp;",0);
             s=replace(s,"&amp;amp;","&amp;",0);
             s=replace(s,"&amp;quot;","\"",0);
             s=replace(s,"&amp;nbsp;"," ",0);
             s=replace(s,"&amp;apos;","'",0);





            /* s=replace(s,"&amp;lt;span","&lt;span",0);
             s=replace(s,"&amp;lt;/span&amp;gt;&amp;amp;","&lt;/span&gt;",0);
             s=replace(s,"&amp;lt;p","&lt;p",0);
             s=replace(s,"&amp;lt;/p&amp;gt;","&lt;/p&gt;",0);
             */





       /*  s = replace(s,"&amp;gt;","&gt;", 0);
         s = replace(s,"&amp;lt;","&lt;", 0);
         s=replace(s,"&amp;amp;","&amp;",0);
         s=replace(s,"&amp;quot;","\"",0);
         s=replace(s,"&amp;nbsp;"," ",0);
         s=replace(s,"&amp;apos;","'",0);
         s=replace(s,"&amp;lt;span","&lt;span&gt;",0);
         s=replace(s,"&amp;lt;/span","&lt;/span&gt;",0);
         s=replace(s,"&amp;lt;p span","&lt;p span&gt;",0);
         s=replace(s,"&amp;lt;/p","&lt;/p&gt;",0);
         s=replace(s,"lt;","&lt;",0);
         s=replace(s,"gt;","&gt;",0);*/
         return s;

        /* s = replace(s,"&amp;gt;","&gt;", 0);
         s = replace(s,"&amp;lt;","&lt;", 0);
          s=replace(s,"&amp;amp;","&amp;",0);
          s=replace(s,"&amp;quot;","\"",0);
          s=replace(s,"&amp;nbsp;"," ",0);
          s=replace(s,"&amp;apos;","'",0);

         return s;*/

     } 





     public  String replace(String source, String search, String replace,int n) {

       while (true) {

             n = source.indexOf(search, n);

             System.out.println("n is "+n);

             if (n == -1) {

                   break;

             }

           source = source.substring(0, n) + replace

                         + source.substring(n + search.length(), source.length());

           //System.out.println("source is"+source);  



           n += replace.length();
       }

       return source;

    }








    class MyWebView extends WebView { 
         Context context; 
         GestureDetector gd; 

        public MyWebView(Context context) { 
        super(context); 

        this.context = context; 
             gd = new GestureDetector(context, sogl); 
        } 

        @Override 
        public boolean onTouchEvent(MotionEvent event) { 
        return gd.onTouchEvent(event); 
        } 

         GestureDetector.SimpleOnGestureListener sogl = new GestureDetector.SimpleOnGestureListener() { 
          public boolean onDown(MotionEvent event) { 
           return true; 
          } 
          public boolean onFling(MotionEvent event1, MotionEvent event2, float velocityX, float velocityY) { 
           if (event1.getRawX() &gt; event2.getRawX()) {

               Intent newIntent=new Intent(context,HomeActivity.class);
                newIntent.putExtra("strUserName", strUsername);
                newIntent.putExtra("strPassWord",strPassWord);
                newIntent.putExtra("questGroupId",questGroupId);
                newIntent.putExtra("userid", userid);
                newIntent.putExtra("systemuserid", "systemuserid");
                newIntent.putExtra("checking", checking);
                //newIntent.putExtra("tableservicevalue", tableservicevalue);
                //newIntent.putExtra("webservicevalue", webservicevalue);
                newIntent.putStringArrayListExtra("parsedValue", parsedValue);
                newIntent.putStringArrayListExtra("articleParsedValue",articleParsedValue);

                newIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                View view = 

HomeActivityGroup.group.getLocalActivityManager().startActivity("Homeactivity",newIntent).getDecorView();
                setContentView(view);

           } 
           else {
               Intent newIntent=new Intent(context,HomeActivity.class);
               newIntent.putExtra("strUserName", strUsername);
                newIntent.putExtra("strPassWord",strPassWord);
                newIntent.putExtra("questGroupId",questGroupId);
                newIntent.putExtra("userid", userid);
                newIntent.putExtra("systemuserid", systemuserid);
                //newIntent.putExtra("tableservicevalue", tableservicevalue);
                //newIntent.putExtra("webservicevalue", webservicevalue);
                    newIntent.putExtra("checking", checking);
                newIntent.putStringArrayListExtra("parsedValue", parsedValue);
                newIntent.putStringArrayListExtra("articleParsedValue",articleParsedValue);
               newIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
      View view = HomeActivityGroup.group.getLocalActivityManager().startActivity("Homeactivity",newIntent).getDecorView();
                setContentView(view);  

           } 
        return true; 
          } 
         }; 


        } 



    }
</code></pre>
