Android Open Source - android-memorytrainer Edit Item Activity






From Project

Back to project page android-memorytrainer.

License

The source code is released under:

GNU General Public License

If you think the Android project android-memorytrainer 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 org.hoffimar.android.memorytrainer;
//from w  w w.jav a2s .c o m
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import com.flurry.android.FlurryAgent;

public class EditItemActivity extends Activity {

  private TextView tv;
  private EditText itemField;
  private Button saveButton;

  private DbAdapter mDbHelper;

  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.edit_item);

    tv = (TextView) findViewById(R.id.EditItemTextView01);
    itemField = (EditText) findViewById(R.id.EditItemEditText01);
    saveButton = (Button) findViewById(R.id.EditItemButtonSave);

    Bundle extras = getIntent().getExtras();
    final int id = extras.getInt("id");

    tv.setText(getString(R.string.edit_item_label) + " " + id + ":");

    saveButton.setOnClickListener(new View.OnClickListener() {

      @Override
      public void onClick(View v) {

        mDbHelper = new DbAdapter(v.getContext());
        mDbHelper.open();

        mDbHelper.updateNote(id, itemField.getText().toString(), "");
        
        FlurryAgent.onEvent(Constants.FLURRY_EVENTID_MAINTAIN_LIST_EDIT_ITEM_SAVE);

        finish();
      }
    });

  }

  @Override
  protected void onStart() {
    super.onStart();
    FlurryAgent.onStartSession(this, Constants.FLURRY_ID);
  }

  @Override
  protected void onStop() {
    super.onStop();
    FlurryAgent.onEndSession(this);
  }

}




Java Source Code List

org.hoffimar.android.memorytrainer.AboutActivity.java
org.hoffimar.android.memorytrainer.CheckLastNumberActivity.java
org.hoffimar.android.memorytrainer.Constants.java
org.hoffimar.android.memorytrainer.DbAdapter.java
org.hoffimar.android.memorytrainer.EditItemActivity.java
org.hoffimar.android.memorytrainer.EditPreferencesActivity.java
org.hoffimar.android.memorytrainer.GenerateNumberActivity.java
org.hoffimar.android.memorytrainer.InformationActivity.java
org.hoffimar.android.memorytrainer.ListHundredActivity.java
org.hoffimar.android.memorytrainer.MaintainListActivity.java
org.hoffimar.android.memorytrainer.Overview.java
org.hoffimar.android.memorytrainer.StatisticsOverviewActivity.java
org.hoffimar.android.memorytrainer.TreeListActivity.java
org.hoffimar.android.memorytrainer.TreeListGenerateActivity.java
org.hoffimar.android.memorytrainer.TreeListVerifyActivity.java
org.hoffimar.android.memorytrainer.model.CellEntry.java
org.hoffimar.android.memorytrainer.model.CellFeed.java
org.hoffimar.android.memorytrainer.model.Cell.java
org.hoffimar.android.memorytrainer.model.Content.java
org.hoffimar.android.memorytrainer.model.Entry.java
org.hoffimar.android.memorytrainer.model.Feed.java
org.hoffimar.android.memorytrainer.model.Link.java
org.hoffimar.android.memorytrainer.model.SpreadsheetEntry.java
org.hoffimar.android.memorytrainer.model.UserFeed.java
org.hoffimar.android.memorytrainer.model.WorksheetEntry.java
org.hoffimar.android.memorytrainer.model.WorksheetsFeed.java