I have a very quick question.
Whenever the user downloads my app, for some reason the volume is at zero. I want to raise the volume whenever the user enters the app for the first time, and update something. Whenever the app is created, I want the users volume to be increased, and the user can change that later. If the user leaves the app (home menu) and comes back, that code should not execute.
So, I thought I would use the Application class:
That didn't work, since to do the update I mentioned earlier, I would need to call a non-static method. To do this, I would create an object of the class where the method is, and call it from there.
The problem with that is that the method has never been called before, and it has lots of null objects then. So, there will be a null pointer exception.
So, how can I achieve this? Only have the volume increase if the user has come back after closing the app or it is the first time the user is downloading the app. Doesn't matter if the app is still open in background. I also need to call another method from there when the app starts...which would get a nullpointerexception.
So now I am lost. How can I achieve this?
Thanks,
Ruchir
See Question&Answers more detail:os