2
I wanted to know how to open a dialog so the user can insert text, as soon as he click the button, the box to type is opened and as soon as he type will have a save and cancel button, how can I do this ?
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 don’t know how to go to the layout through the Intent
, I am layman on android
My onActivityResult()
is already being used for something else, has problem about 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();
}
}
Don’t you just need to open the dialog? this "grav_som" is the layout that has the dialog? your concern and when you click "cancel"?
– Wellington Avelino
I just want to open the dialog, the grav_som would be the layout you gave me, and my concern is when you click the button, it opens the dialog where is the layout you gave me in your reply
– Gabriel Santana Bonatto
Already tested? dialog opened?
– Wellington Avelino
he doesn’t open, he closes the program
– Gabriel Santana Bonatto
Put the Log Cat error to analyze! @Gabriel Santana Bonatto
– Wellington Avelino
sorry for the delay, but I’m not able to get the right information from the logcat of android studio, it is different from the eclipse that I was using, could help about this?
– Gabriel Santana Bonatto
I never used Android Studio. The log Cat, does not show the released errors?
– Wellington Avelino
show, but there’s a lot of strange thing, if you want I take all this and put here, want?
– Gabriel Santana Bonatto