Android : AlertDialog takes time to respond with lenghty message in android

on Tuesday, August 5, 2014


I am using an alertdialog to show some text as message. but the message contains around 2000 lines. so when i click to show the dialog it's taking minimum of 7 - 9 seconds to show the dialog and it's taking 4 - 6 seconds to respond like scrolling or clicking on negative button after the dialog getting opened. please help me on this. below is the code.


note :: 'content' below is the message to show in dialog.



AlertDialog.Builder builder = new AlertDialog.Builder(this);
// Make all links behave as intended
Linkify.addLinks(content, Linkify.WEB_URLS);

builder.setTitle(title)
.setMessage(content) // the content is around 2000 lines
.setNegativeButton(negativeButtonTitle,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
});

AlertDialog alert = builder.create();
alert.show();

0 comments:

Post a Comment