2014-10-11 78 views
0

我试图让我的应用程序为我提供了使用哪种浏览器的选择。我已将网址分配给http://google.com。当我运行它时,我得到一个'没有应用程序可以执行此操作'的错误。我错过了一些东西,我无法弄清楚。接收没有应用程序可以执行此操作错误

public class myClass{ 


static private final String URL = "http://www.google.com"; 
.. 
.. 

implicitActivationButton.setOnClickListener(new OnClickListener() { 

      // Call startImplicitActivation() when pressed 
      @Override 
      public void onClick(View v) { 

       startImplicitActivation(); 

      } 
     }); 

private void startImplicitActivation() { 


     Log.i(TAG, "Entered startImplicitActivation()"); 

     Intent baseIntent = new Intent(Intent.ACTION_SEND,Uri.parse(URL)); 

     String title = "Choose Browser"; 
     Intent chooserIntent = Intent.createChooser(baseIntent, title); 

     Log.i(TAG,"Chooser Intent Action:" + chooserIntent.getAction()); 

     startActivity(chooserIntent); 
    } 
... 
... 

} 

回答

2

要查看网页,使用ACTION_VIEW,不ACTION_SEND

+0

完美。谢谢 – EricH 2014-10-11 22:42:35

相关问题