Skip to content

Instantly share code, notes, and snippets.

@sakurabird
Created October 10, 2013 18:33
Show Gist options
  • Save sakurabird/6923208 to your computer and use it in GitHub Desktop.
Save sakurabird/6923208 to your computer and use it in GitHub Desktop.
(android)TwitterにIntentを送る
String textString = "てすと";
String url = "https://twitter.com/intent/tweet?source=webclient&text=" + textString;
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(url));
startActivity(intent);
try {
startActivity(intent);
} catch (Exception e) {
Toast.makeText(getApplicationContext(), "Twitterアプリがインストールされていません", Toast.LENGTH_LONG)
.show();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment