package com.rhomobile.rhodes;


import com.rhomobile.rhodes.extmanager.RhoExtManager;
import com.rhomobile.rhodes.RhodesActivity;

import android.app.Activity;
import android.R;
import android.app.Dialog;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;


public class PasswordDialog  {
	
	public static EditText        mEditText;
	public static TextView            text;
	public static Button dialogOKButton;
	public static Button dialogCancelButton;
	
	public static void createpopup() {
		
		// custom dialog
		final Dialog dialog = new Dialog(RhodesActivity.getContext());
		
		dialog.setContentView(RhoExtManager.getResourceId("layout","password_prompt"));
		dialog.setTitle("Please enter password");
		dialog.setCanceledOnTouchOutside(false);
		
		// set the custom dialog components - text, view and button
		  mEditText = (EditText) dialog.findViewById(RhoExtManager.getResourceId("id","edit_text"));
		  text = (TextView) dialog.findViewById(RhoExtManager.getResourceId("id","text"));
		 dialogOKButton = (Button) dialog.findViewById(RhoExtManager.getResourceId("id","dialogButtonOK"));
		 dialogCancelButton = (Button) dialog.findViewById(RhoExtManager.getResourceId("id","dialogButtoncancel"));
		
		dialogOKButton.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				checkpassword();
			}
		});
		
		dialogCancelButton.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				dialog.dismiss();
			}
		});

		dialog.show();
	  }
	
	private static void checkpassword(){
		if(mEditText.getText().toString().equals(RhodesService.getExitPasswordValue()))
			RhodesService.PerformRealExit();
		
		else
			{
			text.setText("Invalid Password");
			mEditText.setText("");
			}
	}	

	 
}    


	


@@ -122,16 +122,68 @@
 ctivity;
+%0Aimport com.rhomobile.rhodes.util.PerformOnUiThread;
 %0A%0Aimport
@@ -1933,9 +1933,4 @@
    %0A
-%0A%0A%09%0A%0A

Update PasswordDialog.java