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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:09:50+00:00 2026-05-17T19:09:50+00:00

Possible Duplicate: Passing a Int value to another class I have been trying to

  • 0

Possible Duplicate:
Passing a Int value to another class

I have been trying to get “getExtra” to work but without success, I have a listview with 4 choices which launch a webpage within a webView class, when the user selects the option lets say option 3 I want to pass the value of 3 to the webView class so that it will load the correct webpage, at the moment I get no errors, but the app force closes when I select the option, could this be due to having to announce this in the manifest? can somebody help with where I am going wrong.

This is my intent

public void onListItemClick(ListView l, View v, int position, long id) {

         if (position == 0)  {
         Intent intent = new Intent(this, official.class);
         intent.putExtra("weburl", 3);

         startActivity(intent);}

This is the official class:

public class official extends Activity {

int number = getIntent().getIntExtra("weburl", 0);

   @Override

public boolean onKeyDown(int keyCode, KeyEvent event) {

    if ((keyCode == KeyEvent.KEYCODE_BACK) && mWebView.canGoBack()) {

        mWebView.goBack();

        return true;
    }
    return super.onKeyDown(keyCode, event);
}
    WebView mWebView;

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

        mWebView = (WebView) findViewById(R.id.webview);
        mWebView.getSettings().setJavaScriptEnabled(true);

if (number == 2)    mWebView.loadUrl("http://bcafc.livewwware.co.uk");
  if (number == 3)   mWebView.loadUrl("http://www.bbc.co.uk");
  mWebView.setWebViewClient(new HelloWebViewClient());
  • 1 1 Answer
  • 2 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-05-17T19:09:51+00:00Added an answer on May 17, 2026 at 7:09 pm

    Move int number = getIntent().getIntExtra("weburl", 0); line to onCreate of the official class. If you still get an error, you may want to post the log

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

Sidebar

Related Questions

Possible Duplicate: Passing a class (“Country.class”) as an argument in Java I am trying
Possible Duplicate: Xcode: Storyboard Tabbed Application Passing Data Back and Forth Basically I have
Possible Duplicate: Passing varible types though mod-rewrite howdy, I'm using the get method on
Possible Duplicate: passing an empty array as default value of optional parameter in c#
Possible Duplicate: PHP passing parameters via URL I know that if you have a
Possible Duplicate: Is Java pass by reference? I have a question about passing by
Possible Duplicate: MySQL query using an array Passing an array to mysql I have
Possible Duplicate: Why passing &error instead of error in Cocoa programming? I have a
Possible Duplicate: Passing data between asp.net pages how to pass value of TEXTBOX from
Possible Duplicate: passing value to JSP via javaScript i want to pass value of

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.