Re-enable camera Preview using DialogBox (Android)
<p>I am working on a camera app which uses the Preview class and I need some help on that.
Inside the OnPreviewFrame I inserted a DialogBox which is created through the following function, which is now part of my Preview class. Inside the dialog box I am trying to insert 2 buttons:
The first one exits the app and the other one re-enables the Preview. I managed to make the Exit button work, but I have difficulties implementing the second one (Repeat button in the code).</p>

<p>Can anyone please help me with it?</p>

<p>Thank you.</p>

<p>public void Dialogbox(String message) {</p>

<pre><code>    AlertDialog.Builder alertbox = new AlertDialog.Builder(getContext());

    alertbox.setTitle("Received Message");
    alertbox.setMessage(message);

    alertbox.setCancelable(false);
    alertbox.setPositiveButton("Repeat", new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int arg1) {
               //???

        }
    });
    alertbox.setNegativeButton("Exit", new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int arg2) {
               Preview.this.surfaceDestroyed(mHolder);      
               System.exit(0);
           }
       });

       alertbox.show();
}
</code></pre>
