/ Published in: Java
Expand |
Embed | Plain Text
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Intent intent = new Intent("com.twidroid.SendTweet"); intent.putExtra("com.twidroid.extra.MESSAGE", "This is a test from Twidroid public intent."); try { startActivityForResult(intent, 1); } catch (ActivityNotFoundException e) { /* Handle Exception if Twidroid is not installed */ TextView text = (TextView) findViewById(R.id.message); text.setText("Twidroid Application not found."); } } }); }
Comments
Subscribe to comments
You need to login to post a comment.

See here how to send direct messages
Is it possible to shorten the provided URL in the text message via this service, please?
You now (I do not what version from) need to provide the MIME type, which can be "text/plain", "text/twitter", "application/twitter", "image/jpeg", image/png" according to what you intend to do, and the MIME type is set via a
intent.setType().This is good, but as edouardmercier says you have to set the intent type using the following:
intent.setType("application/twitter");To see this and some other improvements that can be made see this blog post