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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:44:23+00:00 2026-06-07T00:44:23+00:00

I am facing a problem. I have a Class that extends listactivity and its

  • 0

I am facing a problem.
I have a Class that extends listactivity and its code is like this :

public class QuestionListActivity extends ListActivity
{
//Members

private ImageButton bntRefresh;
private ImageButton bntSettings;
private ImageButton bntGetSurveys;


 /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.surveylist);

    initialize();

    currentSurveys=new SurveyList();
 }

private void initialize()
{
    bntRefresh= (ImageButton) findViewById(R.id.ibtnRefresh);
    bntRefresh.setImageResource(R.drawable.refresh);
    bntRefresh.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
        Toast.makeText(SurveyListActivity.this, "This will refresh the survey list.", Toast.LENGTH_SHORT).show();   
        }
    });



    bntSettings= (ImageButton) findViewById(R.id.ibtnSettings);
    bntSettings.setImageResource(R.drawable.settings);
    bntSettings.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            Toast.makeText(SurveyListActivity.this, "This will open the settings.", Toast.LENGTH_SHORT).show(); 
        }
    });

    bntGetSurveys= (ImageButton) findViewById(R.id.ibtnGetSurveys);
    bntGetSurveys.setImageResource(R.drawable.getsurvey);
    bntGetSurveys.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) 
        {
            AlertDialog getSurveyAlert = new AlertDialog.Builder(QuestionListActivity .this).create();
            getSurveyAlert.setTitle("Enter QR Code");
            getSurveyAlert.setMessage("Choose a source");
            getSurveyAlert.setButton("Camera", new DialogInterface.OnClickListener() {

                @Override
                public void onClick(DialogInterface dialog, int which) {

                }
            });
            getSurveyAlert.setButton2("text", new DialogInterface.OnClickListener() {

                @Override
                public void onClick(DialogInterface dialog, int which) {

                }
            });
        }
    });
}

    class SurveyAdapter extends ArrayAdapter<Survey>
    {
      //-- code here for adapter
    }
}

In my initialize function you can see I have three imagebuttons and I have implemented onClicklisteners for them.
For the Settings and refresh button I have shown a Toast, and it is working fine.
For the Get Button I have shown a dialog box which further asks the user to do something, but the problem I am facing is that dialog box is not appearing and I don’t have any idea why ?

  • 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-07T00:44:24+00:00Added an answer on June 7, 2026 at 12:44 am

    AlertDialog getSurveyAlert = new AlertDialog.Builder(QuestionListActivity.this).create();
    // use this line instead of this

    AlertDialog getSurveyAlert = new AlertDialog.Builder(QuestionListActivity .this).show();

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

Sidebar

Related Questions

I have this service: public class AAAService extends Service { private Intent requestService; private
i am facing one problem.i have a class named ReportingService and it should be
hi im new to jquery and im facing these problem i have these code
I am facing a strange problem and have no idea how to fix this
I'm facing a problem that seems to have no straighforward solution. I'm using java.util.Map
I'm facing a problem that I can summarize as it follows: I have a
I am facing a strange problem while running my application. I have a class
I have Person class which is root of its aggregate, this aggregate also contains
I am facing problem during event handling. The problem is like this: My GUI
In the code below the problem i m facing is that in onTouchListener method

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.