how to covert edittext datatype to an integer ?

name = (EditText) findViewById(R.id.editText_name);
mob = (EditText) findViewById(R.id.editText2_mob);
pmob = (EditText) findViewById(R.id.editText3_pmob);
course = (EditText) findViewById(R.id.editText4_course);

result= (TextView) findViewById(R.id.result);
dbHandler = new DBHandler(this, null, null, 1);
printDatabase();
}

//Add a product to the database
public void addButtonClicked(View view){

//showing error msg int his line below
Students student= new Students(name.getText().toString(),mob.getText(),pmob.getText(),course.getText().toString());
dbHandler.addToDB(student);
printDatabase();
}

Show Accepted Answer

Guest Quick Reply (No URL, BBcode or HTML)

Last post by garth43
1 hour ago
Last post by gerhold.blaise
4 hours ago
Last post by proob
4 hours ago
Last post by mayer.willis
3 hours ago
Last post by oconner.maudie
44 minutes ago
Last post by michaela.kreiger
3 hours ago
Last post by avis10
2 hours ago
Last post by uwilkinson
58 minutes ago
Last post by yjaskolski
31 minutes ago