Android Open Source - AutoHosts Append Item Activity






From Project

Back to project page AutoHosts.

License

The source code is released under:

MIT License

If you think the Android project AutoHosts 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 com.yeyaxi.AutoHosts;
// w  w w  .  ja  va2  s  . c  om
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

/**
 * @author Yaxi Ye
 */
public class AppendItemActivity extends BaseActivity
{

  EditText items;
  Button ok;
  Button cancel;

  public void onCreate (Bundle icicle)
  {

    super.onCreate(icicle);
    this.setContentView(R.layout.appenditem);
    items = (EditText) this.findViewById(R.id.txt_addhosts);
    ok = (Button) this.findViewById(R.id.btn_ok);
    cancel = (Button) this.findViewById(R.id.btn_cancel);

  }

  public void onStart ()
  {
    super.onStart();

    ok.setOnClickListener(new OnClickListener()
    {

      @Override
      public void onClick (View v)
      {
        Intent intent = new Intent();
        intent.putExtra("NewEntry", items.getText().toString());
        AppendItemActivity.this.setResult(BaseActivity.APPEND_ITEM_REQUEST_CODE, intent);
        AppendItemActivity.this.finish();
      }

    });

    cancel.setOnClickListener(new OnClickListener()
    {

      @Override
      public void onClick (View v)
      {
        finish();
    }

    });

  }
}




Java Source Code List

com.yeyaxi.AutoHosts.AppendItemActivity.java
com.yeyaxi.AutoHosts.AutoHostsActivity.java
com.yeyaxi.AutoHosts.BaseActivity.java
com.yeyaxi.AutoHosts.CommandRunner.java
com.yeyaxi.AutoHosts.FileCopier.java
com.yeyaxi.AutoHosts.FileDeleter.java
com.yeyaxi.AutoHosts.RootChecker.java
com.yeyaxi.AutoHosts.SystemMount.java
com.yeyaxi.AutoHosts.UnableToMountSystemException.java
com.yeyaxi.AutoHosts.WebFileDownloader.java