【发布时间】:2019-02-14 08:43:47
【问题描述】:
我只是想问你如何使用 webview 和从 edittext 输入的字符串? 例如,我创建了 2 个片段,其中一个显示 webview,另一个从用户那里获得 2 个编辑文本。我只想输入从 2. 片段到 1. 片段的编辑文本值。因为我想创建一个这样的 URL:webView.loadUrl("http://www.truebilisim.com/myiphone/index.php?id=" + ID + "&sifre=" + Password);
这是我的第一个片段。
<FrameLayout 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"
tools:context=".Tab1">
<WebView
android:id="@+id/webView1"
android:layout_width="match_parent"
android:layout_height="match_parent" />
这是第二个。
<FrameLayout 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"
tools:context=".Tab2">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:paddingTop="80dp"
android:paddingRight="30dp"
android:paddingLeft="30dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Tab2">
<ImageView
android:src="@drawable/logo_small"
android:id="@+id/logo"
android:layout_marginBottom="30dp"
android:layout_width="match_parent"
android:layout_height="100dp" />
<android.support.design.widget.TextInputLayout
android:id="@+id/layout_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/logo">
<EditText
android:hint="ID"
android:textColor="@color/colorPrimary"
android:id="@+id/idx"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="@+id/layout_pass"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/layout_id"
>
<EditText
android:inputType="textPassword"
android:hint="Şifre"
android:textColor="@color/colorPrimary"
android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</android.support.design.widget.TextInputLayout>
<Button
android:id="@+id/btn_login"
android:layout_below="@id/layout_pass"
android:backgroundTint="@color/colorPrimaryDark"
android:text="KAYDET"
android:layout_marginTop="30dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
</RelativeLayout>
【问题讨论】: