Android, what can i do with that listener i click on the button and doesnt responce
<p>i don't know what is wrong with that code ..the emulator works but the button does not work with the listener.i did everything i cleaned the project and also i made a listener and it supposed to work.</p>

<pre><code>package com.example.dialog;

import android.os.Bundle;
import android.view.View;

import android.widget.Toast;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.app.Dialog;
import android.content.DialogInterface;

public class MainActivity extends Activity {
    CharSequence[] items = { "Goolge", "Apple", "MaC Os" };
    boolean[] checkedItems = new boolean[items.length];

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        // Button btn= (Button)findViewById(R.id.dialog);
        // btn.setOnClickListener((OnClickListener) this);
    }

    public void onClick(View v) {
        showDialog(0);

    }

    protected Dialog onCreatDialog(int id) {
        switch (id) {
        case 0 :
            Builder builder = new AlertDialog.Builder(this);
            builder.setIcon(R.drawable.ic_launcher);
            builder.setTitle("this is a List of items..");
            builder.setNegativeButton("Ok",
                    new DialogInterface.OnClickListener() {

                        @Override
                        public void onClick(DialogInterface arg0, int arg1) {
                            Toast.makeText(getBaseContext(), "Ok clicked",
                                    Toast.LENGTH_SHORT).show();

                        }
                    });
            builder.setPositiveButton("Cancel",
                    new DialogInterface.OnClickListener() {

                        @Override
                        public void onClick(DialogInterface dialog, int which) {
                            Toast.makeText(getBaseContext(), "cancel cliked",
                                    Toast.LENGTH_SHORT).show();

                        }
                    });
            builder.setMultiChoiceItems(items, checkedItems,
                    new DialogInterface.OnMultiChoiceClickListener() {

                        @Override
                        public void onClick(DialogInterface dialog, int which,
                                boolean isChecked) {
                            Toast.makeText(
                                    getBaseContext(),
                                    items[which]
                                            + (isChecked ? " checked"
                                                    : " unchecked"),
                                    Toast.LENGTH_SHORT).show();

                        }
                    });
            return builder.create();

        }

        return null;

    }

}


&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity" &gt;



        &lt;Button
            android:id="@+id/dialog"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:onClick="onClick"
            android:text="@string/click_me" /&gt;



&lt;/RelativeLayout&gt;
</code></pre>
