Ads

Check out Abanoub's website for more up-to-date content.

Android intent to share on Twitter

Using Intent in Java code to share text via twitter app on Android is easy to implement, so here is a snippet code.
String twUrl = "http://www.twitter.com/intent/tweet?text=" + "text to share via twitter app or twitter for web";
Intent twi = new Intent(Intent.ACTION_VIEW);
twi.setData(Uri.parse(twUrl));
startActivity(twi);
If twitter app is installed, the share will be via twitter app. And if not installed, the text will be shared via twitter for web.

Want to see more interesting posts? check out the new tech blog.