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 8734445
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:50:33+00:00 2026-06-13T09:50:33+00:00

This is the code I have. In my main .java file. public void showQuiz

  • 0

This is the code I have.

In my main .java file.

public void showQuiz (View view){
        Username = (EditText) findViewById(R.id.Username);
        String userId = Username.getText().toString();
        String deviceId = Secure.getString(this.getContentResolver(),
                Secure.ANDROID_ID);
       //this intent is used to open other activity wich contains another webView
         Intent intent = new Intent(this, Quiz.class);

         Bundle bun = new Bundle();
         bun.putString("userid",userId);
         bun.putString("deviceid", deviceId);

         intent.putExtras(bun);
         startActivity(intent); 
    }

This is what is in the Activity’s .java file.

package com.earn.egpt;

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

public class Quiz extends Activity {
    private static final String url = "http://www.m.s-w-family.com/?subid=";
    private static final String url2 = "&deid=";

     @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_quiz);
            Bundle extras=getIntent().getExtras();
            String userId=extras.getString("userId");
            String deviceId=extras.getString("deviceId");
         WebView webview;
        webview = (WebView) findViewById(R.id.webView1);
        webview.getSettings().setJavaScriptEnabled(true);
        webview.loadUrl(url+userId+url2+deviceId);
        }
    }

for some reason it is passing the strings as null, but I have no idea why. I am extremely new to this kind of programming so I don’t even know where to being. I have looked at other problems similar to mine and tried the fixes for them, but the values are still null.

  • 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-13T09:50:34+00:00Added an answer on June 13, 2026 at 9:50 am

    You are using an extra Bundle by accident. Put the extras directly into the Intent instead:

    intent.putExtra("userid", userId);
    intent.putExtra("deviceid", deviceId);
    
    startActivity(intent); 
    

    Now your getString() methods will return what you want in Quiz.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code : void Main() { System.Timers.Timer t = new System.Timers.Timer (1000);
I have this code in a single file : public class genIntro { public
I Have just started learning Android, this is the code of my java file.
This is my code in my main java file. How would i make another
This is the code I have in a file called Test2.java in a package
i have this code to download a single file . import java.io.FileOutputStream; import java.io.IOException;
This is the code I have: Sub Main() Dim dts As New DataSet Dim
I have this code: #include <stdio.h> #include <openssl/sha.h> #include <openssl/ssl.h> int main(){ printf(OpenSSL version:
I have this code which does the trick: #include <stdio.h> int main() { int
So I just have posted a question about this code (which was answered): $(document).ready(Main);

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.