0

I have simple AlertDialog with following piece of code

AlertDialog.Builder dialog = new AlertDialog.Builder(con);
dialog.setTitle(title);
dialog.setMessage(strEula);
dialog.setPositiveButton(" OK ", new DialogInterface.OnClickListener() {
    public void onClick(DialogInterface dialog, int id) {
        dialog.dismiss();

    }
});
dialog.show();

But i have huge message i.e. it has complete EULA(End Used License Agreement) text. Thus, it has around 1000 lines in it. So whenever i show this dialog it takes around 15 second to render and became active to handle user interaction.

Please, let me know if there is any way to minimize these 15sec lag. Thanks

ANUP
  • 185
  • 1
  • 5
  • 14
  • 1
    I'm curious as to how you store your EULA -- when I put it in `strings.xml` as a string resource, and retrieve it with `getString(R.string.eula)` my AlertDialog displays within 3 seconds. This is on an old phone running 2.3.3. – savanto Apr 30 '14 at 02:14
  • I agree. @ANUP are you retrieving it from the web or locally? – Justin Jasmann Apr 30 '14 at 02:24
  • Yes, i get it from network. But Network call is fast enough to return it. For testing i kept everything same and instead of EULA text i displayed some lines of static text. It worked very fast. – ANUP Apr 30 '14 at 22:49
  • Did you solve this problem. I am interested in, after you fixed 15 sec lag, how do you make the message scroll? I have the same demand to put long message like you, but it will make the OK, Cancel button out of screen. – Fisher Jan 22 '18 at 09:19
  • possible duplicate of https://stackoverflow.com/questions/10699644/show-long-message-in-alertdialog – computingfreak Apr 11 '18 at 07:00

0 Answers0