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
  • 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-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: Solution for overloaded operator constraint in .NET generics I have a problem
Possible Duplicate: Smart pointers/safe memory management for C? I have an embedded application where
Possible Duplicate: Javascript: find the time left in a setTimeout()? I'm trying to use
Possible Duplicate: Is there a better way than parsing /proc/self/maps to figure out memory
Possible Duplicates: Pass by value vs Pass by reference performance C#.net Did anyone already
Possible Duplicate: Why am I getting Undefined index from my PHP? $pattern2 = /([A-Za-z0-9\.\-\_\!\#\$\%\&\'\*\+\/\=\?\^\`\{\|\}]+)\@([A-Za-z0-9.-_]+)(\.[A-Za-z]{2,5})/;
Possible Duplicate: Should I learn C before learning C++? As a professional (Java) programmer
Possible Duplicates: “const T &arg” vs. “T arg” How to pass objects to functions
Possible Duplicates: When pass-by-pointer is preferred to pass-by-reference in C++? Are there benefits of
I'd want to hear various opinions how to safely use c++ in mission critical

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.