Note that there are some explanatory texts on larger screens.

plurals
  1. POmultiple onCreate(Bundle under one activity for webview and button
    primarykey
    data
    text
    <p>I built a web app, and I am making a wrapper to put it on the app store. I have a main page, or start page for the app, and the submit button successfully loads my webview page, and the app works well.</p> <p>I wanted to add a small webview above the submit button where I could display updated news before users enter the app, such as new terms of use.</p> <p>I followed examples to get the webview to load on the main page, and it works - the content is displayed, but when I add the webview, the submit button doesn't work any longer.</p> <p>Eclipse throws an error "Duplicate Method OnCreate(Bundle) in type TOS, so I tried changing OnCreate to OnStart or OnCreateView for the button. It renders from the layout xml, but there is no functionality. I'm certain it is a novice syntax error, so I've just posted the Tos.java code:</p> <pre><code> package com.barglance.android; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.webkit.WebView; import android.content.Context; import android.content.Intent; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; public class Tos extends Activity { private Button button; public void onCreate(Bundle savedInstanceState) { final Context context = this; super.onCreate(savedInstanceState); setContentView(R.layout.activity_tos); button = (Button) findViewById(R.id.buttonUrl); button.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { Intent intent = new Intent(context, Mapp.class); startActivity(intent); } }); } private WebView TermswebView; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_tos); WebView TermswebView = (WebView) findViewById(R.id.webView); TermswebView.loadUrl("http://www.mydomain.com/assets/tos/tos.php"); }; }; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload