package edu.oswego.vocabv4; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.TextView; public class Item extends Activity { private Intent intent = null; private Word w = null; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_item); intent = getIntent(); String what = intent.getStringExtra(MainActivity.EXTRA_MESSAGE); w = intent.getParcelableExtra("word"); TextView tv1 = (TextView) findViewById(R.id.odtext1); tv1.setText(w.lexeme()); tv1.setTextSize(16 * getResources().getDisplayMetrics().density); TextView tv2 = (TextView) findViewById(R.id.odtext2); tv2.setText(w.getDefinition()); tv2.setTextSize(16 * getResources().getDisplayMetrics().density); } public void od_back(View v) { setResult(Activity.RESULT_OK, intent); intent.putExtra(MainActivity.EXTRA_MESSAGE, "Showed def for " + w); finish(); } }