I would like to know how to open a dialog so that the user can enter text, as soon as he clicks the button, the box to type is opened and as soon as he type it will have a save and cancel button, how can I do that?
private ImageView imgsavesom;
imgsavesom = (ImageView) findViewById(R.id.imgsavesom);
imgsavesom.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v) {
//Criar um objecto File com o caminho actual
Intent intent = new Intent("grav_som"); //grav_som eh o nome do layout
startActivity(intent);
}
});
I do not know how to go to the layout through Intent
, I am lay in android
My onActivityResult()
is already being used for something else, has problem on startActivity (intent); ?
@Override
public void onActivityResult(int reqCode, int resCode, Intent data) {
super.onActivityResult(reqCode, resCode, data);
if(resCode == RESULT_OK) {
if (reqCode == 1)
contactImgView.setImageURI(data.getData());
Uri imageUri = data.getData();
imagePath = getImagePath(imageUri);
Toast.makeText(MainActivity.this, imagePath, Toast.LENGTH_LONG).show();
}
}