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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:24:34+00:00 2026-05-26T18:24:34+00:00

I have a ListView and I’m using SimpleCursorAdapter to populate the content, and newView

  • 0

I have a ListView and I’m using SimpleCursorAdapter to populate the content, and newView & bindView to get the View.

I want to enable that everytime the button on the row list is clicked, it loads an AlertDialog box.

Here’s the code:

btn.setOnClickListener(new OnClickListener() {
 public void onClick(View view) {
    Intent intent = getIntent();
    if (intent != null) {
    Uri uri = intent.getData();
    if (uri != null) {
    Cursor cursor = managedQuery(uri, new String[] {
    BaseColumns._ID, Database.Project.C_PRICE, Database.Project.C_KEYWORD,
    Database.Project.C_SHORTCODE}, null, null, null);

if (cursor == null) {
finish();
} else {
if (cursor.moveToFirst()) {

AlertDialog.Builder alertbox = new AlertDialog.Builder(this);                                             
alertbox.setTitle("SMS");

I always get an error on this line: AlertDialog.Builder alertbox = new AlertDialog.Builder(this);

It says: The constructor AlertDialog.Builder(new View.OnClickListener(){}) is undefined

how am I able to do that?

  • 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-26T18:24:34+00:00Added an answer on May 26, 2026 at 6:24 pm

    You are using this to create the AlertDialog.Builder which is wrong use Activity_name.this. You are applying the button’s listener’s reference to create the AlertDialog.Builder rather you should have the reference of the Activity.

    AlertDialog.Builder alertbox = new AlertDialog.Builder(Activity_name.this);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a listview with a DataTemplate that has a ComboBox. I want the
I have a ListView control that is in FullRowSelect mode, MultiSelect off and using
I have a ListView that gets updated frequently, at irregular intervals. I want it
I would have listview and a lot of items inside. I want that user
I have a ListView that contains button on each item. I want that the
I have ListView that has the following EditItemTemplate: <EditItemTemplate> <tr style=> <td> <asp:LinkButton ID=UpdateButton
I have a ListView in WPF that is databound to a basic table that
I have a ListView on a page that displays a list of widgets. When
We have ListView.Groups in .NET. Is there an equivalent in Qt (without using Windows
I have a ListView that contains a large collection of rows with textboxes that

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.