Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
twicca plugin - share a status url
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" android:theme="@android:style/Theme.Translucent">
<activity
android:label="@string/activity_name"
android:name=".TweetLinkShare">
<intent-filter>
<action android:name="jp.r246.twicca.ACTION_SHOW_TWEET" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
Intent intent = getIntent();
String status_id = intent.getStringExtra("id");
String screen_name = intent.getStringExtra("user_screen_name");
String url = "https://twitter.com/#!/" + screen_name + "/status/" + status_id;
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.addCategory(Intent.CATEGORY_DEFAULT);
shareIntent.setType("text/plain");
shareIntent.putExtra(Intent.EXTRA_TEXT, url);
startActivity(shareIntent);
finish();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment