title: Android: Starting An Activity For A Different Third Party App
body: <p>I'm working on an app and I want to integrate the Last.fm app into it. Basically, when someone is looking at an artist in my app, I would like to have a button that they can tap to open up Last.fm application with the artist's information.</p>
  
  <p>This intent works, but it loads a menu asking which app I would like to use (Browser or Last.fm):</p>
  
  <pre><code>Intent i = new Intent();
  i.setData(Uri.parse("http://last.fm/music/" + headliner));
  i.setAction("android.intent.action.VIEW");
  startActivity(i);
  </code></pre>
  
  <p>However, I just want to start the Last.fm app and skip the dialog asking which app to use, I thought maybe using the setPackage() method would work like this: </p>
  
  <pre><code>i.setPackage("fm.last.android");
  </code></pre>
  
  <p>But it causes the app to crash:</p>
  
  <pre><code>android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=http://last.fm/music/Rihanna pkg=fm.last.android }
  </code></pre>
  
  <p>Is it possible to just start the Last.fm app? <a href="http://github.com/c99koder/lastfm-android/blob/master/app/AndroidManifest.xml" rel="noreferrer">Here's</a> a copy of Last.fm's AndroidManifest.xml for reference.</p>
  
  <p>Thanks for reading,
  Tony</p>