Back to project page ribbit.
The source code is released under:
MIT License
If you think the Android project ribbit listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.lleshiart.ribbit; //w ww . jav a 2 s . c o m import android.app.Activity; import android.app.AlertDialog; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.view.Window; import android.widget.Button; import android.widget.EditText; public class NewMessageActivity extends Activity { protected EditText mMessageText; protected Button mSendMessageButton; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); setContentView(R.layout.activity_new_message); mMessageText = (EditText) findViewById(R.id.sendMessageField); mSendMessageButton = (Button) findViewById(R.id.sendMessageButton); mSendMessageButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { setProgressBarIndeterminateVisibility(true); String message = mMessageText.getText().toString(); message = message.trim(); if (message.isEmpty()) { // Display error AlertDialog.Builder builder = new AlertDialog.Builder(NewMessageActivity.this); builder.setTitle(R.string.send_message_error_title) .setMessage(R.string.send_message_error_message) .setPositiveButton(android.R.string.ok, null); AlertDialog dialog = builder.create(); dialog.show(); } else { Intent intent = new Intent(NewMessageActivity.this, RecipientsActivity.class); intent.putExtra(ParseConstants.KEY_FILE_TYPE, ParseConstants.TYPE_TEXT); intent.putExtra(ParseConstants.KEY_MESSAGE, message); startActivity(intent); finish(); } setProgressBarIndeterminateVisibility(false); } }); } }