I got this code (relevant part only):
public class MainActivity extends AppCompatActivity {
private WebView webView;
private int whichPage = 0;
protected void onCreate(Bundle savedInstanceState) {
webView = (WebView) findViewById(R.id.webView);
webView.setWebViewClient(new WebViewClient());
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl(this.getString(whichPage == 0 ? R.string.vPlan : R.string.tPlan));
}
}
In the OptionsMenu the user can change the page... Now my problem is that each time the user turns his/her phone it will load R.string.vPlan even if it was set to tPlan (and whichPage contained 1).
Is there a way to stop the app from jumping to vPlan or even stop it from loading a page at all?
Thank you.