• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Error when running

 
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

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



Errors

 
Marshal
Posts: 4526
572
VSCode Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

Yes it does.



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

 
Ron McLeod
Marshal
Posts: 4526
572
VSCode Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 4179
22
IntelliJ IDE Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?

reply
    Bookmark Topic Watch Topic
  • New Topic