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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:45:52+00:00 2026-05-26T19:45:52+00:00

I have made a application which reads information from an Api. Link : http://api.amp.active.com/camping/campground/details?contractCode=CO&parkId=50032&api_key=2chxq68efd4azrpygt5hh2qu

  • 0

I have made a application which reads information from an Api.

Link : http://api.amp.active.com/camping/campground/details?contractCode=CO&parkId=50032&api_key=2chxq68efd4azrpygt5hh2qu

Following is my code :

NodeList list = element.getElementsByTagName("detailDescription");

        Log.i("ZealDeveloper","I M In detail   "+list.getLength());             
        if(list != null && list.getLength() > 0){


            for(int i = 0; i < list.getLength(); i++){

                entry = (Element) list.item(i);

                description = entry.getAttribute("description");
                drivingDirection = entry.getAttribute("drivingDirection");
                latitude=entry.getAttribute("latitude");
                longitude=entry.getAttribute("longitude");

            }               
        }

        NodeList list1 = element.getElementsByTagName("amenity");

        Log.i("ZealDeveloper","I M In 2   "+list1.getLength());

        if(list1 != null && list1.getLength() > 0){

            for(int i = 0; i < list1.getLength(); i++){
            entry = (Element) list1.item(i);

            nameAmenity = entry.getAttribute("name");

            listAmenity.add(nameAmenity);

            }               

            arrAmenity = listAmenity.toArray(new String[listAmenity.size()]);

            StringBuilder builder = new StringBuilder();

            for ( int i = 0; i < arrAmenity.length; i++ ){

                 builder.append(arrAmenity[i]+"\n");

            }
            txtAmenity.setText(builder);
    }

#

I am Getting list.getLength() as 0(was getting 1 in pervious versions of android) , so the parser this condition. For amenity tag i m getting the desired list size.

  • 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-26T19:45:53+00:00Added an answer on May 26, 2026 at 7:45 pm

    The only reason I can think of is that “detailDescription” is already root of the document so probably element is the tag you are seeking for. It doesn’t have any children with the name “detailDescription” so getElementsByTagName("detailDescription") returns empty list. So change first half of your code as follows:

        Log.i("ZealDeveloper","I M In detail   " + element.getTagName()); 
        if(element.getTagName().equalsIgnoreCase("detailDescription")) {
    
                description = element.getAttribute("description");
                drivingDirection = element.getAttribute("drivingDirection");
                latitude = element.getAttribute("latitude");
                longitude = element.getAttribute("longitude");
        }  
    
        /* rest of your code...*/
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have made an application which uses latest ios facebook sdk to connect. I
I have made a sample application which constructs a filter graph to capture audio
Visual Studio 2010 Express, Windows Forms. Have made myself my first little application which
I have made a swings application but there is one problem in that which
i have a windows application made in VB.NET which maintains a database, and i
I have an application in which we use a hand-made build system.The reason for
I have made an application project in Visual Studio 2008 C#, SQL Server from
I made an application and a dll, which are working this way: I have
I have made a swing application which uses image files located in a folder
we have a C++ class which basically reads and writes vectors from a binary

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.