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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T17:42:19+00:00 2026-06-05T17:42:19+00:00

This is a continuance from a SO Q here but I am still missing

  • 0

This is a continuance from a SO Q here but I am still missing something.

I dont know how to get a item that was mapped out from a JSONObject for a list view. The HashMap key value is:

map.put(TAG_RES_FILE, resFile);

And I would like to put that String into my onItemClick(){int passResFile = getResources().getIdentifier(TAG_RES_FILE, "raw", "com.andaero.app");}

I thought by putting the tag name in the method below, the system would automatically pull it from that item position – obviously not. So how do it get it?? Thnx.

EDIT: I added a log.i() to see what values are within the position that is clicked and it returns:

getIdentifier(11925): {isRawRes=true, title=Advisory Circulators,
label=AC, _id=1, resFile=advisory_circulators_sort_list,
description=Provides guidance such as methods, procedures, and
practices for complying with regulations and requirements.,
containerID=R.id.listContainer}

It’s the

resFile=advisory_circulators_sort_list

That is what I need to get – How do I do this??

This is the whole listener:

public void onItemClick(AdapterView<?> parent, View view, int pos, long id) {
                    MainActivity.mLayout.toggleSidebar();
                    setHasOptionsMenu(true);

                    FragmentManager fm = getFragmentManager();
                    final FragmentTransaction lcFT = fm.beginTransaction();
                    lcFT.setCustomAnimations(R.anim.slide_in, R.anim.hyperspace_out, R.anim.hyperspace_in, R.anim.slide_out);

                    final Bundle args = new Bundle();

                    Object o = lv.getItemAtPosition(pos);
                    String resFile = (String) o.toString();
                    int passResFile = getResources().getIdentifier(TAG_RES_FILE, "raw", "com.andaero.app");
                    args.putInt("KEY_RES_FILE", passResFile);

                    boolean isRawRes = true;
                    args.putBoolean("KEY_IS_RAW_RES", isRawRes);
                    Log.i("getIdentifier", resFile );

                    // Delayed to improve animations
                    final Handler handler = new Handler();
                    handler.postDelayed(new Runnable() {
                        public void run() {
                            ListViewFragment lvf = new ListViewFragment();
                            lcFT.replace(R.id.listContainer, lvf).commit();
                            lvf.setArguments(args);
                        }
                    }, 300);
                }
  • 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-05T17:42:21+00:00Added an answer on June 5, 2026 at 5:42 pm

    So I went ahead and sent the item to a textView and set it’s visability to gone in the layout file. This works just fine but I was hopeing for a better/cleaner way of doing it.

    Changed within the onItemClick() method from:

    Object o = lv.getItemAtPosition(pos);
    String resFile = (String) o.toString();
    int passResFile = getResources().getIdentifier(TAG_RES_FILE, "raw", "com.andaero.app");
    args.putInt("KEY_RES_FILE", passResFile);
    

    To this:

    String resFile = ((TextView) view.findViewById(R.id.listResFile)).getText().toString();
    int passResFile = getResources().getIdentifier(resFile, "raw", "com.andaero.app");
    args.putInt("KEY_RES_FILE", passResFile);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This has been asked several times, i know, but help me understand something. You
This is my first post here and I wanted to get some input from
This is a super simple issue that I can't figure out. I want to
This is beyond both making sense and my control. That being said here is
This is a difficult and open-ended question I know, but I thought I'd throw
this is my first question in here, and I would like to ask if
This is in regards to merge XCode project.pbxproj files, but the same principle applies
This is my first time creating a PHP form that will run a MySQL
This is my first attempt at reverse engineering, and really, I don't know how
This is as close as I've gotten to successfully populating an expandable listview from

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.