Skip to content

Instantly share code, notes, and snippets.

@koush
Created July 11, 2012 02:03
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save koush/3087486 to your computer and use it in GitHub Desktop.
Save koush/3087486 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 framework source.
// this let me inspect the contents of the intent.
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();
}
@HackerMager
Copy link

kq4gftk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment