public void onClick(View v) {
if (v.getId() == R.id.fab9) {
//somehow before showing action bar i need to create password varification
getSupportActionBar().show();
}
}
if (v.getId() == R.id.fab9) {
AlertDialog alertDialog = new
AlertDialog.Builder(<YourActivityName>this).create();
alertDialog.setTitle("Security Purpose");
alertDialog.setMessage("Please Enter Password");
final EditText input = new EditText(MainActivity.this);
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.MATCH_PARENT);
input.setLayoutParams(layoutParams);
alertDialog.setView(input);
alertDialog.setButton("Checking Info", new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog, int which) {
String password = input.getText().toString()
if(password.equals('<Enter Details as per your convenience>'){
alertDialog.show();
}else{
//do else code
}
}
});
}