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

  • Home
  • SEARCH
  • 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 8110549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T01:47:43+00:00 2026-06-06T01:47:43+00:00

Here is my scenario: I have two MySQL tables: Categories (columns: id, category) Items

  • 0

Here is my scenario:

I have two MySQL tables:

Categories (columns: id, category)
Items (columns: id, item, category_id)

Android part:

I have an app that opens to a ListView populated from the table called “Categories”. It does this just fine. What I would like to do is make each category item in the ListView clickable to open to a new ListView populated with items from the “Items” table (where each getPosition() = category_Id).

I can figure out that last bit of it with the PHP query. I am not sure how to make the Android part work. Do I reuse the same ListView? Does each click open a new activity?

Can someone show me a very simple example (even in psudo-code) of how this can work?

  • 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-06T01:47:45+00:00Added an answer on June 6, 2026 at 1:47 am
    listView.setOnItemClickListener(new OnItemClickListener() {
    
            @Override
            public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long id) {
    
                String category = YOUR_ArrayList.get((int) id);
                Bundle d = new Bundle();
                d.putString("category", category);
                                Intent itemIntent = new Intent(this, ItemActivity.class);
                prodottiIntent.putExtras(d);
                startActivity(itemIntent);
            }
        });
    

    Now in your itemActivity you should only take your bundle d (category)

                Bundle d = getIntent().getExtras();
        String category = d.getString("category");
    

    And now with your string “category” you can search in your database and display all the items that have the category that you pressed

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

Sidebar

Related Questions

Here's the scenario -- I have two tables Names & Sentences: Names Sentences ID
Here is my scenario: I have two tables: subfirms and subfirmdetails. I am trying
Here's my scenario: I have two tables A, B which (for the sake of
Here's the scenario: I have 2 tables with data, one is the 2009 version
Here's the scenario: I have 2 tables: CREATE TABLE dbo.API_User ( id int NOT
Here's the scenario: I have a table with 3 columns: 'KeyColumn', 'SubKeyColumn' and 'BooleanColumn',
I have a scenario like this: There are two tables table1 and table2 .
Here's the scenario: You have two seperate websites that exist in different environments (I.E.
Here is a simple scenario: assuming I have two Core Data entities: A and
here's my scenario: I have three projects: two DLLs and one console application, let's

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.