title: Activity crash when open external url
body: <p>I have an activity that opens another activity and in this I can not make the code run to open an external URL in android Studio. 
  The app breaks...
  I used the internet permission.</p>
  
  <p>code:</p>
  
  <pre><code>public void onClick(View v){
      Intent intent = new Intent();
      intent.setAction(Intent.ACTION_VIEW);
      intent.addCategory(Intent.CATEGORY_BROWSABLE);
      intent.setData(Uri.parse("https://www.google.com.br"));
      startActivity(intent);
  }
  </code></pre>
  
  <p>Do I need to create another JavaClass to enter these codes, or can I use it in MainActivity java?</p>
  
  <p><strong>Logcat</strong></p>
  
  <blockquote>
  <pre><code>Process: br.com.vinnydantas.curriculo, PID: 3355
  java.lang.IllegalStateException: Could not find method Linkedin(View) in a parent or ancestor Context for android:onClick attribute defined on view class android.widget.ImageView with id 'imageLinkedin'
      at android.view.View$DeclaredOnClickListener.resolveMethod(View.java:4479)
      at android.view.View$DeclaredOnClickListener.onClick(View.java:4443)
      at android.view.View.performClick(View.java:5198)
      at android.view.View$PerformClick.run(View.java:21147)
      at android.os.Handler.handleCallback(Handler.java:739)
      at android.os.Handler.dispatchMessage(Handler.java:95)
      at android.os.Looper.loop(Looper.java:148)
      at android.app.ActivityThread.main(ActivityThread.java:5417)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
  </code></pre>
  </blockquote>