Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8957163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:55:27+00:00 2026-06-15T14:55:27+00:00

users have an activity with an edittext and a button. in the edittext they

  • 0

users have an activity with an edittext and a button.
in the edittext they have to insert their login ID. and press go to display a other activity with webview loading the right site.

an example. this is the link i want users to visit . http://www.example.com/time/id=1/type=student

if sombody enters a 2 in the edittext it wil open the times for student id 2 and so on.

this is what i have.

LOGIN

package com.beter;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.app.Activity;
import android.content.Intent;


public class LoginActivity extends Activity {

Button go_btn;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.login);

            go_btn = (Button) findViewById(R.id.go_btn);




      go_btn.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            // TODO Auto-generated method stub
            Intent myIntent = new Intent(LoginActivity.this, WebActivity.class);
            LoginActivity.this.startActivity(myIntent);
        }
    });      
}

and the layout

<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" >

<EditText
    android:id="@+id/idfield"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentLeft="true"
    android:layout_alignParentTop="true"
    android:ems="10"
    android:hint="@string/id"
    android:inputType="number" >

    <requestFocus />
</EditText>

<Button
    android:id="@+id/go_btn"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentRight="true"
    android:layout_alignParentTop="true"
    android:layout_toRightOf="@+id/idfield"
    android:text="@string/login" />

The Webview Activity

package com.beter;

import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;

public class WebActivity extends Activity  {


@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.webview);


    WebView webview = new WebView(this);
    setContentView(webview);


    webview.loadUrl("http://roosters.gepro-osi.nl/roosters/rooster.php?wijzigingen=1&leerling=116277&type=Leerlingrooster&afdeling=12-13_OVERIG&school=905");
}
}

and again the layout

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

    <WebView
        android:id="@+id/webView1"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</LinearLayout>

How do i make the user input. display the good webview. ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T14:55:28+00:00Added an answer on June 15, 2026 at 2:55 pm

    First of all get a reference to your edittext in your Login Activity as

     go_btn = (Button) findViewById(R.id.go_btn);
     ed_txt = (EditText)findViewById(R.id.youredittextid);
    

    The change your onClick to

    public void onClick(View v) {
      Intent myIntent = new Intent(LoginActivity.this, WebActivity.class);
      myIntent.putExtra("id", ed_txt.getText());
      LoginActivity.this.startActivity(myIntent);
    }
    

    Then retrive this id in your WebActivity onCreate as

    String id = getIntent().getExtras().getString("id");
    

    Then your url will be

    String myURL = "www.example.com/time/id="+id+"/type=student";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an activity that when users press share on a file it would
I have an activity that lets the user load some data when they press
I have this textbox in the other activity and a button which leads to
I have an activity setup with an edittext field and an add button. Essentially
I have implemented activity with edittext and button: After user entered a password and
I have an Activity with EditText and Button widgets. Clicking the button prints an
I have an Activity with an EditText, Button and TextView. If I write some
So i have this test Activity with 3 elements: TextView, EditText, Button. When user
I have an activity that contains several user editable items (an EditText field, RatingBar,
I have a developer eyes-only activity that I don't want end users to reverse

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.