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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T23:44:48+00:00 2026-05-29T23:44:48+00:00

I am currently working on Android I have a xml which is like this:

  • 0

I am currently working on Android

I have a xml which is like this:

<Point pointid =1> // first point tag
  <a>
</Point>
<Point pointid =4> // second point tag
 <a>
</Point>

I am fetching the pointid attribute from XML with this code:

NodeList listOfPersonsi = doc.getElementsByTagName("Point");
String p = ((Element)listOfPersonsi.item(i)).getAttribute("pointid");

here i value will be 0 for first point and 1 for second point.

I have a button called next when i click on that button I am incrementing the i value, but I want something like this if the pointid = 1 I have to perform some action and if pointid = 4 i need to perform different action.

so

if(i == 0) // i value may be 1,2...etc
    {
       if(pointid == 1)
       { 
            "one functionality "

        }else if(pointid == 4)
        {
            " another functionality"
         } 
     }

but I want to acheive this dynamically I dont want to hardcode it as 1 and 4 to perform some action

Please help

  • 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-29T23:44:50+00:00Added an answer on May 29, 2026 at 11:44 pm

    Create a List<Integer> pointIds and as you parse the xml, call pointIds.add(pointId) as you find additional ids. Then modify your code to see if later pointId.equals(pointIds.get(0)). This entire mechanism seems pointless. I’m having trouble deducing why you need this to be “dynamic”.

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

Sidebar

Related Questions

I'm currently working on Mangler's Android implementation. I have a java class that looks
I am new to android development. Currently i am working on an application which
I'm currently working on an Android app. I would like to use the app
I am currently working on one android application which has C2DM implementation and I
I am currently working on an android project. I am trying to have an
I currently have an ImageView which i am applying a scale animation to. This
I am currently working on my first android app. In a listview, I need
I'm curently working on my first Android app, which is my first pice of
I am currently working on an android project where I want to have the
I am currently working on an Android tablet application which has two fragments, a

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.