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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:33:42+00:00 2026-06-12T10:33:42+00:00

At some point, I need to queue Alertdialogs with questions to the user, waiting

  • 0

At some point, I need to queue Alertdialogs with questions to the user, waiting for him/her to answer them one by one.
The code would be something like:

for (int i=0; i<SomeValue; i++)
{
    Msg = "Do you want to add " + mylist.get(i) + " to the system?";
    AlertDialog ADB = new AlertDialog.Builder(this)
      .setIcon(android.R.drawable.ic_dialog_alert)
      .setTitle("New document " + mylist.get(i))
      .setMessage(Msg)
      .setPositiveButton("Add", new DialogInterface.OnClickListener() {

  @Override
  public void onClick(DialogInterface dialog, int which) {
      // Function to develop

   }
   })
.setNegativeButton("Ignore", null)
.show();
}

So, developing for onClick function: how do I know there which is the Alertdialog associated?
For example, how can I get to know, from the onClick function, what is the title of the current Alertdialog?

  • 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-12T10:33:44+00:00Added an answer on June 12, 2026 at 10:33 am

    Now, you can’t access the default title so you’ll need to set the title with : setCustomTitle(View v) – just make it a simple layout XML file with you title TextView
    in it.

    Cast the DialogInterface to AlertDialog in the onClick() method like this:

    ((AlertDialog)dialog)
    

    now you can access whatever you want like that:

    ((AlertDialog)dialog).findViewById(R.id.YOUR_TITLE_TEXTVIEW_ID).getText()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing a library to IOS, which at some point need to create a
At some point I need to display a disabled (greyed out by disabled=disabled attribute)
I need a script that inserts a number at some point into a file
I have some function where I need to pass a point datatype . somefunc(United
At some point I must have moved files from one location to another using
I need to set up a queue system using some SQL tables, like the
i'm currently doing a project related to AWS and at some point will need
I have users sending emails with some text I need to extract. Each user's
I have some questions as to which overloaded method would be called in certain
I'm working with some Google maps bounding box lon/lat points and need to find

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.