Skip to content

Instantly share code, notes, and snippets.

@ampersandcastles
Forked from koush/poop.java
Created July 11, 2012 02:08
Show Gist options
  • Save ampersandcastles/3087501 to your computer and use it in GitHub Desktop.
Save ampersandcastles/3087501 to your computer and use it in GitHub Desktop.
try {
packman.getPackageInfo("com.twitter.android", 0);
builder.setNeutralButton(R.string.follow_koush, new OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
// this is the intent you actually want.
// grabbed this by hooking a debugger up to twitter and debugging into android source.
Intent i = new Intent();
i.setClassName("com.twitter.android", "com.twitter.android.ProfileActivity");
i.putExtra("screen_name", "koush");
try {
startActivity(i);
}
catch (Exception ex) {
// uh something failed
ex.printStackTrace();
}
}
});
}
catch (Exception ex) {
// not installed
ex.printStackTrace();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment