App Runs Fine The First Time But Crashes The Second Time
My title is pretty self explanatory. Here's my code: public class MainActivity extends Activity { private WebView browse; private TextView t; private String address='
Solution 1:
refresh = gPrefs.getInt("Refresh", 1);clearcache = gPrefs.getInt("ClearCache", 1);time = gPrefs.getInt("Time", 0);
The first time the app run, it uses the default value you use (1,1,0) above.
But the second time, it certainly uses the data you've saved from a user input perhaps.
You must be saving it as a string and trying to retrieve it as an int...
Solution 2:
The error is very clear: java.lang.String cannot be cast to java.lang.Integer You are trying to cast a String object to an Integer. That cannot be done. They are not of the same type.
The error tells you at what line of your file that happened, so you can correct it. MainActivity.java:37
Post a Comment for "App Runs Fine The First Time But Crashes The Second Time"