Android WebVieClient sendet keine Formulare

Dimax

Top Contributor
Guten Tag,
ich habe eine Internet Seite probiert mit WebView in Android zu öffnen das Problem ist, dass die Seite wird korrekt dargestellt aber beim click auf ein button zum Senden der Login Daten passiert nichts. Also die Links auf der Seite funktionieren aber der Button nicht.Woran könnte es liegen?

MainActivity.java
Java:
package com.example.daaa;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class MainActivity extends AppCompatActivity {


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        WebView webView =  this.findViewById(R.id.webview);

        WebViewClient webViewClient = new WebViewClient();
        webView.setWebViewClient(webViewClient);

        webView.loadUrl("https://meineSeite.de/hura");
    }

}

AndroidManifest.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.example.daaa">


    <uses-permission
        android:name="android.**permission.INTERNET" />

    <application
        android:fullBackupContent="true"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:usesCleartextTraffic="true"
        android:theme="@style/AppTheme"
        tools:ignore="GoogleAppIndexingWarning">

        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />

            </intent-filter>
        </activity>
    </application>

</manifest>

activity_main.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <WebView
        android:id="@+id/webview"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>
Danke für jede Hilfe.
 

Dimax

Top Contributor
Ich habe die Lösung gefunden , danke an alle .

2 Zeilen die das Problem gelöst haben.

MainActivity.java
Code:
WebSettings webSettings = webView.getSettings();
webSettings.setJavaScriptEnabled(true);
 

Ähnliche Java Themen

Neue Themen


Oben