Win a copy of hapi.js in Action this week in the HTML, CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Error when running

 
Gil Carvalho
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I having some trouble finding what's wrong with this code.



Errors

 
Ron McLeod
Bartender
Posts: 1178
100
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems like the numbering in the stack trace doesn't line-up with the numbering in your source.

Does: at gmc.ebspmamobile.Splash$DownLoadAndInstallApp.onPreExecute(Splash.java:118)
refer line #93 in your source: dialog = new ProgressDialog(Splash.this);?
 
Gil Carvalho
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Yes it does.



I don't understand what's going on....

 
Ron McLeod
Bartender
Posts: 1178
100
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It would seem like Splash.this is null - you could easily check. If that is the case, then you could try passing-in context as a parameter.

private Context context;
public DownLoadAndInstallApp(Context context) {
    this.context = context;
}

@Override
protected void onPreExecute() {
    super.onPreExecute();
    dialog = new ProgressDialog(context);
    dialog.setMessage("Donwload da atualização!");
    dialog.setCanceledOnTouchOutside(false);
    dialog.show();
}
 
Gil Carvalho
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Thank you

That was the problem...but now the log cat give me a strange error.





And those lines referes to this
06-10 11:42:24.195: E/WindowManager(6930): at gmc.categorias.WVersionManager.showDialog(WVersionManager.java:85) (dialog.show();) dialog.show();



And this
06-10 11:42:24.195: E/WindowManager(6930): at gmc.categorias.WVersionManager$VersionContentRequest.onPostExecute(WVersionManager.java:250) showDialog();


What's wrong now??

Thank you for your help
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The 'leaked resource' means you have some resource, in this case a dialog, which you opened and didn't close - or at least 'let it out in the wild' so it might escape un-closed.

For your particular case, I would suspect you have one dialog being shown multiple times without being dismissed between, or you have multiple dialogs being shown at the same time. It also could be you have the dialog shown and not being dismissed before the Activity it belongs to is destroyed. I can't really tell which is the case, but you should use LogCat and/or debug breakpoints to determine what is happening.
 
Gil Carvalho
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Steve

I have already used the logCat. But i'm trying to follow that error and you are right about the dialog not be dismissed. But i should dismiss since i have this code



right?
 
Gil Carvalho
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

The the error is gone but the alertDialog disapears after few seconds without the user input.
I don't have any error
The last problem was using



in Splash activity.

But now i have that strange behaviour.

Anything wrong here?

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!