[android-developers] Re: exception when create new AlertDialog
Show us the Logcat
On Sunday, April 14, 2013 3:55:42 PM UTC+1, Carlos Calvo wrote:
--Hello,I have a ProgressDialog running. Execute method ".dismiss" for destroy them.But when i create a new AlertDialog i take a exception because the progessdialog yet still showException "Unable to add window -- token null is not for an application"The code:if (pd.isShowing()){pd.dismiss();}MainActivity.this.runOnUiThread(new Runnable() { public void run() {AlertDialog.Builder builder = new AlertDialog.Builder(getApplication()); builder.setTitle("Lo sentimos por el Fallo").setMessage("Resolveremos el fallo lo antes posible").setCancelable(false).setIcon(R.drawable.ic_exception) .setPositiveButton("Enviar Fallo",new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) {//enviar por mail traza exceptionmDamageReport.submit( new Exception() );finish();}}).setNegativeButton("Cerrar",new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog,int id) {finish();}});builder.create().show();}});
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home