1
I’m having a problem with the buttons created in Alertdialog. I am making a phrase APP and at certain times the sentences are very large and causes the buttons in Alertdialog to drop. Is it possible to fix these buttons? Here follows an example of what happens: http://www.mediafire.com/view/ykk010cb8jcb6v5/Screenshot_20170607-111014.png
This is my code:
// ALERT DIALOG
//atributo da classe.
//Cria o gerador do AlertDialog
AlertDialog.Builder builder = new AlertDialog.Builder(FraseAutorFrase.this);
builder.setTitle("O que deseja fazer?");//define o titulo
builder.setMessage("\nFrase: " + frasesR [position]);//define a mensagem
builder.setView(checkBoxView);
//define um botão como positivo
builder.setNeutralButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface arg0, int arg1) {
}
});
//define um botão como compartilhar
builder.setPositiveButton("Compartilhar", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface arg0, int arg1) {
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, frasesR[position] );
sendIntent.setType("text/plain");
startActivity(sendIntent);
}
});
alerta = builder.create();//cria o AlertDialog
alerta.show();//Exibe
Thank you very much!!!
Why don’t you create a scroll in the phrase?
– Luiz Lanza
Try entering your code to your question. This increases the chance that you have a more accurate answer.
– viana
Hi, Luiz. I wouldn’t know how to implement Scroll, I actually saw an alternative that would have to change the layout, but I’ll try.
– Tisco
Thank you, Aclay.
– Tisco