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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:43:25+00:00 2026-05-22T02:43:25+00:00

I have a Arraylist of String type. How can i display it on a

  • 0

I have a Arraylist of String type. How can i display it on a dialogue to a user and him select the one.also the need is to highlight the earlier selection in the made by the user.
Some code example will be helpful.
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-05-22T02:43:25+00:00Added an answer on May 22, 2026 at 2:43 am

    Try this code in ur onCreate

    protected CharSequence[] Months = { "January", "February", "March", "April", "May","June", "July", "August", "September","October","November","December" };
    Button selected_month = ( Button ) findViewById( R.id.button );
    selected_month.setOnClickListener(new View.OnClickListener(){
                           new AlertDialog.Builder( <Classname>.this )
                      .setTitle( "Months" )
                          .setSingleChoiceItems( Months, 0, new DialogInterface.OnClickListener(){
    
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    // TODO Auto-generated method stub
                    Toast.makeText(<Classname>.this, Months[which], Toast.LENGTH_SHORT).show();
                }
    
            })
            .setPositiveButton( "OK", new DialogButtonClickHandler() )
            .setNegativeButton("No", new DialogButtonClickHandler() )
            .create();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a object type list like List<Object> getRecords = records.getAllRecords(); ArrayList<String> recordsDetail =
Can't figure this one out I have an ArrayList of classes: // Holds an
I have an ArrayList<String> that I'd like to return a copy of. ArrayList has
I have an ArrayList<String> , and I want to remove repeated strings from it.
I have a method that returns an IEnumerable<KeyValuePair<string, ArrayList>> , but some of the
E.G. to create an ArrayList of Strings we have to do something like List<String>
I have an array of strings. How can I convert it to System.Collections.ArrayList?
I have an arraylist that gets different type of values in it, 1st value->
I have two objects of same type. Class A { String a; List b;
I want to add both String and Integer type of value in ArrayList. For

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.