//this for getting path
if ((resultCode == RESULT_OK) && (data != null)) {
if ((data != null) && (data.getData() != null)) {
//this code returns content directory path
getAudioPath=data.getData().getPath().toString();
edAudio.setText(getAudioPath);
}
}
//this for sending to sqlite database
boolean isInserted = myDb2.insertGraduateData(edId.getText().toString(),
edName.getText().toString(), edDeg.getText().toString(),getAudioPath);
if (isInserted == true)
Toast.makeText(AddGraduates.this, "Data inserted", Toast.LENGTH_LONG).show();
else
Toast.makeText(AddGraduates.this, "Data not inserted", Toast.LENGTH_LONG).show();
Aucun commentaire:
Enregistrer un commentaire