Issue
I just want to ask you how can i use webview with an entered strings from edittext? For example, i created 2 fragment one of these shows webview and another one gets 2 edittext from users. I just want to get entered edittext values from 2. fragment to 1. fragment. Because i want create a URL like this : webView.loadUrl("http://www.truebilisim.com/myiphone/index.php?id=" + ID + "&sifre=" + Password);
This is my first fragment.
<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" />
And this is the second one.
<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>
Solution
Your question is too big to answer here. And its not specific. I'm just going to mention the steps. You'll find code for specific parts if you search properly.
Initialize your
EditTexts. You you'll send the values from theEditText's when the user clicks the login button.Set
onClickListeneron the login button. Inside the listener, check if yourEditTextshave value or not. If they have value, goto the other fragment.Send the values of
EditTextto the other fragment, you can do this in multiple ways. One is, just get an instance to the destination fragment object, and send the value.
Answered By - Hasanuzzaman Mamun
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.