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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T20:48:09+00:00 2026-06-06T20:48:09+00:00

i have a listview with 3 text. NV1 – NV2 – NV3. My problem

  • 0

i have a listview with 3 text. NV1 – NV2 – NV3. My problem is when I touch on NV1 the intent show me the layout of NV1. But with the others nothing happen. It just show me the same NV.

I create a 2 method for passing the info.

    private void adapter (PT1Activity a){
      this.a = a;
  }

private void showGame(int nivel){
    Intent intent = new Intent (PT1Activity.this, NV1.class);
    intent.putExtra("nivel2", nivel);
    startActivity(intent);
}

And a:

private PT1Activity a;

adapter(this);

       ltNvs.setOnItemClickListener(new OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> arg0, View arg1, int position,
                long arg3) {


             a.showGame(position);
        }
    });

What I have to do? Pass the information to the other NV2 Activity with a Bundle?? Or something similar?

  • 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-06T20:48:10+00:00Added an answer on June 6, 2026 at 8:48 pm

    Your showgame function should be something like this:

    private void showGame(int nivel){
    Intent intent;
    switch (nivel){
        case 1:
          intent = new Intent (PT1Activity.this, NV1.class);
          intent.putExtra("nivel1", nivel);
          break;
        case 2:
          intent = new Intent (PT1Activity.this, NV2.class);
          intent.putExtra("nivel2", nivel);
          break;
        case 3:
          intent = new Intent (PT1Activity.this, NV3.class);
          intent.putExtra("nivel3", nivel);
          break;
        default:
          intent = new Intent();
       }
    
    startActivity(intent);
    }
    

    However, this assumes all your classes are in the same package. If you want to launch an activity in a different package, the Intent(this, yourclass.Class) constructor won’t work. Instead, try something like this:

    Intent intent = new Intent();
    intent.setComponent(ComponentName.unflattenFromString("your.other.package/your.other.package.your_other_class_name"));
    startActivity(intent);
    

    Note: your_other_class_name would be something like NV1, not NV1.class.

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

Sidebar

Related Questions

I use a ListView for text-items in my APP. But I have one problem:
I have a layout requirement like below, Textview TextView ListView Edit Text Button Since
I'm trying to have a ListView with icon and text but there is a
I have a listview, and i start an intent to fill it. But the
I have a ListView in a ListActivity populated with strings. However, only the text-part
I have fetched images and text as listview from database.now on clicking the particular
I have a issue with my listview, I basicly want the text in the
I have ListView. Every row has TextView with some text. And also by default
I have a ListView with edit text in each items and I want to
I have one listview.which contain one image ,text and one button .i had creted

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.