Use Twidroid's public intent to send Twitter messages from your own Android application


/ Published in: Java



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

URL: http://www.twidroid.com

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.