get Finish Dialog On Click Listener - Android User Interface

Android examples for User Interface:Dialog

Description

get Finish Dialog On Click Listener

Demo Code


//package com.java2s;
import android.app.Activity;

import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;

public class Main {
    public static OnClickListener getFinishDialogOnClickListener(
            final Activity activity) {
        return new OnClickListener() {
            @Override// w  w w  .  ja  v a  2  s .c o  m
            public void onClick(DialogInterface arg0, int arg1) {
                activity.finish();
            }
        };
    }
}

Related Tutorials