Log in or register to post comments

Starts Activity 2 times for 1 reco

May 12, 2014 - 12:24am #1

Hey,

When 1 image is recognized my activity is created 2 times. My snippet is like this;

 

   if(trackable.getName().startsWith("woops")){
         Uri uri = Uri.parse("smsto:4848");   
              Intent it = new Intent(Intent.ACTION_SENDTO, uri);   
                             it.putExtra("sms_body", "WOOPS");  
         
              mActivity.startActivity(it);
        }
        
        else{
           String url = "http://www.aveaprime.com.tr/";
            if(!url.startsWith("http://") && !url.startsWith("https://")){
                url= "http://" + url;
            }
          
            Intent u = new Intent(Intent.ACTION_VIEW);
            u.setData(Uri.parse(url));
            mActivity.startActivity(u);
        }
 
For example, when app recognize an image that has a name starts with "woops", it opens 2 sms windows consecutive. What can be wrong? 
 
Thanks.
Log in or register to post comments