Twidroid Public Intent for Twitter Direct Messages


/ Published in: Java
Save to your folder(s)



Copy this code and paste it in your HTML
  1. final Button button2 = (Button) findViewById(R.id.senddirect);
  2. button2.setOnClickListener(new View.OnClickListener() {
  3. public void onClick(View v) {
  4. Intent intent = new Intent("com.twidroid.SendDirect");
  5.  
  6. /* set recipient of direct message */
  7. intent.putExtra("com.twidroid.extra.TO",
  8. "androidev");
  9.  
  10. /* set direct message content */
  11. intent.putExtra("com.twidroid.extra.MESSAGE",
  12. "This is a test from Twidroid public intent.");
  13.  
  14. try {
  15. startActivityForResult(intent, 1);
  16. } catch (ActivityNotFoundException e) {
  17. /* Handle Exception if Twidroid is not installed */
  18. TextView text = (TextView) findViewById(R.id.message);
  19. text.setText("Twidroid Application not found.");
  20. button2.setVisibility(View.GONE);
  21. }
  22. }
  23. });

URL: http://www.twidroid.com

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.