Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Your code isn't using your XML layout, you're creating your own WebView in code and setting that as the view so it bypasses your XML completely.</p> <p>I've provided a few changes here that should make it work. Pay particular attention to the setContentView line and the following line, these are what use the XML layout. You may need to change the name of the layout (R.layout.whatever) and the webview id (R.id.webview). There may be a few parse errors from me putting it here, might have missed a closing bracket. I deleted much of your commented out code just to keep it simple.</p> <pre><code>@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView( R.layout.xmlLayout ); itsMeLogin = (WebView)findViewById( R.id.webview ); detector = new SimpleGestureFilter(this,this); Toast.makeText(this, "Just Swipe To Exit", Toast.LENGTH_LONG).show(); itsMeLogin.getSettings().setJavaScriptEnabled(true); // JavaScript enabled getWindow().requestFeature(Window.FEATURE_PROGRESS); // Show progress bar of page loading final Activity itsMeActivity = this; itsMeLogin.setWebChromeClient(new WebChromeClient() { public void onProgressChanged(WebView view, int progress){ // Activities and WebViews measure progress with different scales. // The progress meter will automatically disappear when we reach 100% itsMeActivity.setProgress(progress * 100); } }); itsMeLogin.setWebViewClient(new WebViewClient(){ public void onReceivedError(WebView view, int errorCode, String description, String failingUrl){ Toast.makeText(itsMeActivity, "Oh no! " + description, Toast.LENGTH_SHORT).show(); } }); itsMeLogin.loadUrl("http://www.google.com"); } </code></pre> <p>Here's my XML file from a similar layout as well, though yours will probably work with the edited code.</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;GridLayout xmlns:android="http://schemas.android.com/apk/res/android" android:columnCount="3" android:layout_height="match_parent" android:layout_width="match_parent" &gt; &lt;EditText android:ems="4" android:imeOptions="actionNext" android:inputType="number" android:layout_gravity="center_horizontal" android:maxLength="4" android:selectAllOnFocus="true" /&gt; &lt;EditText android:ems="4" android:imeOptions="actionDone" android:inputType="textCapCharacters|textNoSuggestions" android:layout_gravity="center_horizontal" android:maxLength="3" android:selectAllOnFocus="true" /&gt; &lt;Button android:id="@+id/submit" /&gt; &lt;WebView android:id="@+id/webview" android:layout_columnSpan="3" android:layout_gravity="fill" android:layout_height="0dp" android:layout_width="0dp" /&gt; &lt;/GridLayout&gt; </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.
 

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