Return to Snippet

Revision: 10402
at December 25, 2008 14:28 by ralph


Initial Code
final Button button2 = (Button) findViewById(R.id.senddirect);
		button2.setOnClickListener(new View.OnClickListener() {
			public void onClick(View v) {
				Intent intent = new Intent("com.twidroid.SendDirect");
				
				/* set recipient of direct message */
				intent.putExtra("com.twidroid.extra.TO",
				"androidev");
				
				/* set direct message content */
				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.");
				    button2.setVisibility(View.GONE);
				}
			}
		});

Initial URL
http://www.twidroid.com

Initial Description

                                

Initial Title
Twidroid Public Intent for Twitter Direct Messages

Initial Tags
twitter, android

Initial Language
Java