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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T01:53:56+00:00 2026-06-06T01:53:56+00:00

this is my custom dialog class: package com.WhosAround.Dialogs; import com.WhosAround.AppVariables; import com.WhosAround.R; import com.WhosAround.AsyncTasks.LoadUserStatus;

  • 0

this is my custom dialog class:

package com.WhosAround.Dialogs;

import com.WhosAround.AppVariables;
import com.WhosAround.R;
import com.WhosAround.AsyncTasks.LoadUserStatus;
import com.WhosAround.Facebook.FacebookUser;

import android.app.Dialog;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.view.MotionEvent;
import android.view.View;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;

public class MenuFriend extends Dialog{

    private FacebookUser friend;
    private AppVariables app;

    public MenuFriend(Context context, FacebookUser friend) {
        super(context, android.R.style.Theme_Translucent_NoTitleBar);
        this.app = (AppVariables) context.getApplicationContext();
        this.friend = friend;
    }

    public void setDialog(String userName, Drawable userProfilePicture)
    {
        setContentView(R.layout.menu_friend);
        setCancelable(true);
        setCanceledOnTouchOutside(true);        
        TextView name = (TextView) findViewById(R.id.menu_user_name);
        TextView status = (TextView) findViewById(R.id.menu_user_status);
        ImageView profilePicture = (ImageView) findViewById(R.id.menu_profile_picture);
        ImageButton closeButton = (ImageButton) findViewById(R.id.menu_close);
        name.setText(userName);         
        profilePicture.setImageDrawable(userProfilePicture);

        if (friend.getStatus() != null)
            status.setText(friend.getStatus());
        else
            new LoadUserStatus(app, friend, status).execute(0);
        closeButton.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                dismiss();

            }
        })

    }


}

for some reason eclipse tells me the following errors on closeButton imageButton:

The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the arguments (new DialogInterface.OnClickListener(){})

The type new DialogInterface.OnClickListener(){} must implement the inherited abstract method DialogInterface.OnClickListener.onClick(DialogInterface, int)

The method onClick(View) of type new DialogInterface.OnClickListener(){} must override or implement a supertype method

why is 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-06-06T01:53:59+00:00Added an answer on June 6, 2026 at 1:53 am

    The OnClickListener interface comes in subclasses. You are probably importing DialogInterface.OnClickListener, instead of View.OnClickListener.

    The different subclasses of the interface have different implementations of onClick().

    public interface View.OnClickListener() {
        // This implementation gives you a reference to the View that was clicked.
        onClick(View v);
    }
    public interface DialogInterface.OnClickListener() {
        // This implementation gives you references to the dialog in which the click happend
        onClick(DialogInterface dialog, int which);
    }
    

    Change your setOnClickListener to this:

    closeButton.setOnClickListener(new View.OnClickListener() {
    
            @Override
            public void onClick(View v) {
                dismiss();
    
            }
        })
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How does Branchout custom their Request Dialog messages? There is no option for this.
Here is my code: package com.AndroidCustomDialog; import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection; import java.net.MalformedURLException;
i have created a custom dialog class public class NewPost extends Dialog { //
As part of writing custom command (COM-Visible dll with class that implements Interwoven command
I want to implement Custom Dialog in Android. However , when I tried it
I have created a custom dialog box extending the DialogFragment class. As stated in
I'm new to Android development, I needed to implement custom dialog plugin similar to
I am trying to create a custom dialog class that inherits from Dialog that
I have a custom dialog inside public class NewPartnerDialog extends Dialog implements OnClickListener And
Hello i'm implementing a custom dialog. I have a class which extends Dialog .

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.