Make a general input screen
<p>I have a large table with all kinds of strings and numbers, and a number of them have to be editable. The table is loaded from an object with getters and setters of course. </p>

<p>I want to create a general input screen with an edit text and an ok button; and use that to edit the fields. However, i can't get this to work, this is a snippet of my code:</p>

<pre><code>public class InputViewController extends Activity {
private String inputType;
EditText mEdit;
private String inputString;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.inputscreen);
    Bundle extras=getIntent().getExtras();
    {

        //get the type of input from the screen that sent us here, contained in a putextra
        inputType = extras.getString("inputType");

        TextView textViewInput = (TextView) findViewById(R.id.textViewInput);
        textViewInput.setText(inputType);

        mEdit = (EditText)findViewById(R.id.editText1);

    }


//save input and return to previous screen
final Button button = (Button) findViewById(R.id.button3);
button.setOnClickListener(new View.OnClickListener() {
    public void onClick(View v) {

       //save input based on inputType
        if(inputType.equals("Oplossing")){

            inputString = mEdit.getText().toString();
            ActivityViewController.activityObject.setSolution(inputString);
            System.out.println(ActivityViewController.activityObject.getSolution());
            }

        //return to previous screen
        finish();
    }
});
</code></pre>
