Ich habe eine Android-Anwendung, die eine Google-Form in einem Webview hat. Es hat drei Eingabefelder (Name, Adresse und Telefonnummer) und eine Schaltfläche. Ich benötige diese Eingabewerte und das Button-Click-Event zur weiteren Bearbeitung innerhalb der App. Gibt es einen Weg, wie ich das machen kann?Get Button Klicks, Eingabe von Text aus Google Tabellen in Webview
Das Fragment, das das Google-Blatt enthält:
public class Register extends Fragment {
public Register() {
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_register, container, false);
WebView webView = (WebView) view.findViewById(R.id.webView);
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setDomStorageEnabled(true);
webView.setWebViewClient(new WebViewClient());
webView.loadUrl("my google sheet");
return view;
}
}
Die XML-Datei:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffffff">
<!-- TODO: Update blank fragment layout -->
<WebView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/webView"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true" /></RelativeLayout>