Android Open Source - Amppercent7 Text Entry Activity






From Project

Back to project page Amppercent7.

License

The source code is released under:

GNU General Public License

If you think the Android project Amppercent7 listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package my.amppercent.project;
/*from  w w w. j  ava  2 s  . c  o  m*/
import my.amppercent.project.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.EditText;

/**
 * Activity generica e parametrizzata per la richiesta di un unico testo con
 * conferma e cancellazione (back)
 * 
 * @author jack
 * 
 */
public class TextEntryActivity extends Activity {
  private EditText et;

  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_text_entry);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,
        WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
    // title
    try {
      String s = getIntent().getExtras().getString("title");
      if (s.length() > 0) {
        this.setTitle(s);
      }
    } catch (Exception e) {
    }
    // value

    et = ((EditText) findViewById(R.id.txtValue));

    // button
    ((Button) findViewById(R.id.btnDone))
        .setOnClickListener(new OnClickListener() {

          public void onClick(View v) {
            executeDone(et.getText().toString());
          }

        });
    ((Button) findViewById(R.id.btnCancel))
        .setOnClickListener(new OnClickListener() {

          public void onClick(View v) {
            executeDone(null);
          }

        });
  }

  public void onBackPressed() {
    executeDone(null);
    super.onBackPressed();
  }

  private void executeDone(String value) {
    Intent resultIntent = new Intent();
    resultIntent.putExtra("value", value);
    setResult(Activity.RESULT_OK, resultIntent);
    finish();
  }

}




Java Source Code List

my.amppercent.adapters.AdapterChat.java
my.amppercent.adapters.AdapterElems.java
my.amppercent.adapters.AdapterIM.java
my.amppercent.adapters.AdapterUStatus.java
my.amppercent.adapters.ListViewAdapting.java
my.amppercent.adapters.ListView_XUser.java
my.amppercent.chatrequest.AvailabilitySettings.java
my.amppercent.chatrequest.SelectConnActivity.java
my.amppercent.chatrequest.connActivity.java
my.amppercent.chatrequest.serverActivity.java
my.amppercent.chattables.UberChat.java
my.amppercent.chattables.XConnect.java
my.amppercent.chattables.XRoster.java
my.amppercent.chattables.myChat.java
my.amppercent.project.Amppercent4Activity.java
my.amppercent.project.DownloadManager.java
my.amppercent.project.IBindRemoteService.java
my.amppercent.project.LaunchMe.java
my.amppercent.project.PrefActive.java
my.amppercent.project.TabFragment.java
my.amppercent.project.TextEntryActivity.java
my.amppercent.remoteservice.IFMessage.java
my.amppercent.remoteservice.IntentManage.java
my.amppercent.remoteservice.XUser.java
my.amppercent.remoteservice.chatAdapter.java
my.amppercent.types.Couple.java
my.amppercent.types.State.java
my.amppercent.types.myATask.java
my.amppercent.types.myNotification.java
my.amppercent.types.myYesNoDialog.java
my.amppercent.types.newActivity.java
org.jivesoftware.smackx.filetransfer.myOutgoingFileTransfer.java