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.

See you in the next code snippet for Android development. So we made the development easier. 
Comment via Facebook
0 Comment via Google

0 تعليقات:

Post a Comment