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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:56:43+00:00 2026-06-09T21:56:43+00:00

Ok so here’s what I’ve got so far: public class Perks extends ListActivity {

  • 0

Ok so here’s what I’ve got so far:

public class Perks extends ListActivity {

 ArrayList<Item> items = new ArrayList<Item>();
 ArrayList<Item> entry = new ArrayList<Item>();

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);


        items.add(new SectionItem("Tier 1"));
        items.add(new EntryItem("Flak Jacket"));
        items.add(new EntryItem("Ghost"));
        items.add(new EntryItem("Blind Eye"));
        items.add(new EntryItem("Hardline"));
        items.add(new EntryItem("Lightweight"));

        items.add(new SectionItem("Tier 2"));
        items.add(new EntryItem("Hard Wired"));
        items.add(new EntryItem("Scavenger"));
        items.add(new EntryItem("Cold Blooded"));
        items.add(new EntryItem("Toughness"));
        items.add(new EntryItem("Fast Hands"));

        items.add(new SectionItem("Tier 3"));
        items.add(new EntryItem("Engineer"));
        items.add(new EntryItem("Dead Silence"));
        items.add(new EntryItem("Extreme Conditioning"));
        items.add(new EntryItem("Tactical Mask"));
        items.add(new EntryItem("Awareness"));
        items.add(new EntryItem("Dexterity"));

        EntryAdapter adapter = new EntryAdapter(this, items);

        entry.add(new SectionItem("Tier 1"));
        entry.add(new EntryItem("Take less explosive damage."));
        entry.add(new EntryItem("Cannot be detected by enemy UAV while moving."));
        entry.add(new EntryItem("Unaffected by AI-controlled perks."));
        entry.add(new EntryItem("Receive bonus score points."));
        entry.add(new EntryItem("Move faster, take no damage from falling."));

        entry.add(new SectionItem("Tier 2"));
        entry.add(new EntryItem("Immune to counter-UAV and enemy EMPs."));
        entry.add(new EntryItem("Replenish ammo and grenades from fallen enemies."));
        entry.add(new EntryItem("Resistence to targeting systems including Dual Band, Target Finder," +
                "Sensor Grenades and player-controlled aircraft."));
        entry.add(new EntryItem("Flinch less when shot."));
        entry.add(new EntryItem("Swap grenades faster, use grenades and equipment faster, and safely throw" +
                "back frag grenades."));

        entry.add(new SectionItem("Tier 3"));
        entry.add(new EntryItem("Show enemy equipment, delay explosives, and re-roll and booby trap care" +
                "packages."));
        entry.add(new EntryItem("Move silently."));
        entry.add(new EntryItem("Sprint for a longer duration."));
        entry.add(new EntryItem("Reduce the effect of flash, concussiona and shock charges."));
        entry.add(new EntryItem("Enemy movements are easier to hear."));
        entry.add(new EntryItem("Climb ladders and mantle over objects faster, recover from melee faster and" +
                "aim faster after sprinting."));


        setListAdapter(adapter);
    }

    @Override
    protected void onListItemClick(ListView l, View v, int position, long id) {

        if(!items.get(position).isSection()){

            EntryItem item = (EntryItem)items.get(position);

            //Toast.makeText(this, "You clicked " + item.title , Toast.LENGTH_SHORT).show();

                  AlertDialog.Builder adb=new AlertDialog.Builder(Perks.this);
                  adb.setTitle(item.title);
                  adb.setMessage();
                  adb.setPositiveButton("Ok", null);
                  adb.show();
              }


        super.onListItemClick(l, v, position, id);
    }
}

What I’m trying to do is to have it so that when an “item” is pressed, it will show the corresponding “entry” in an AlertDialog. Any help on the matter will be greatly appreciated.

Thanks 🙂

  • 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-09T21:56:44+00:00Added an answer on June 9, 2026 at 9:56 pm

    Well, it looks like your current array lists have the same values for the corresponding indices… in other words.. if the user selects item 2 in the items list, you want to display item 2 in the entry list.

     @Override
        protected void onListItemClick(ListView l, View v, int position, long id) {
    
            if(!items.get(position).isSection()){
    
                EntryItem item = (EntryItem)items.get(position);
                EntryItem discriptor = (EntryItem) entry.get(position);
    
                      AlertDialog.Builder adb=new AlertDialog.Builder(Perks.this);
                      adb.setTitle(item.title);
                      adb.setMessage(discriptor.getTitle()); //get the value of this element.
                      adb.setPositiveButton("Ok", null);
                      adb.show();
                  }
    
    
            super.onListItemClick(l, v, position, id);
        }
    

    Otherwise, I personally think it would be much easier to just create one class to handle both sets of data… e.g.

    public class EntryItem {
    
         private String name;
         private String description;
    
         public EntryItem(String name, String discription){
              this.name = name;
              this.description = discription;
         }
    }
    

    I just think it would be easier to manage this way.. Best of Luck!

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

Sidebar

Related Questions

Here's the view: @if (stream.StreamSourceId == 1) { <img class=source src=@Url.Content(~/Public/assets/images/own3dlogo.png) alt= /> }
Here is my class: public class A{ private void doIt(int[] X, int[] Y){ //change
here is my code, SiteMember class @OneToMany(mappedBy = member,cascade=CascadeType.ALL) private List<MemberThread> memberThread = new
Here is the code I'm using inside my AsyncTask DefaultHttpClient httpClient = new DefaultHttpClient();
Here is my simplified data structure: Object1.h template <class T> class Object1 { private:
Here's my test function (c#, visual studio 2010): [TestMethod()] public void TestGetRelevantWeeks() { List<sbyte>
Here's a very simple repro: Start up VS2010 or VS2008, new a WPF project
Here is my code. I'm new to VBA so, I am unsure how to
Here's my code in the <head></head> : <link rel=stylesheet href=http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css /> <script type=text/javascript src=http://code.jquery.com/jquery-1.7.1.min.js></script>
Here is the code in a function I'm trying to revise. This example works

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.