So, I have the following:
The usual class, in which many of my actions are available in my Android application, by setting the class in my manifest:
<application android:name="com.dev.games.phraseparty.Common"... />
Now in this class I have several objects that are created to preserve the state of the application and common services for running applications created in the Common constructor
t
GameStateVO gameState; public Common() { gameState = new GameStateVO(); }
My problem is that my activity has an admob ad. When a user clicks on an ad, it causes the web browser to open the URL of the ad in the web browser.
Now, when I click back from a web browser launched by admob, it brings me back to calendar activity and the OnCreate method is called.
Then this operation gets a null pointer exception, because it will do something like:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Common common = this.getApplication();
source share