I want to close this inflated layout when click on button of inflated layout. How to achieve this please help me.
li = LayoutInflater.from(VMAdjustFrame.this);
promptsView = li.inflate(R.layout.wishlist_save_prompt, null);
alertDialogBuilder = new AlertDialog.Builder(VMAdjustFrame.this);
alertDialogBuilder.setView(promptsView);
alertDialogBuilder.show();
TextView textView = (TextView)promptsView.findViewById(R.id.textView1);
textView.setText(context.getString(R.string.share_photo));
Listener is called when click on email button
Button emailButton = (Button)promptsView.findViewById(R.id.phoneButton);
emailButton.setText(context.getString(R.string.share_photo_email));
emailButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
}
});
Look at these two lines for changes
Create a AlertDialog Object (instance) from your
alertDialogBuilder.show()method.Using that Instance call
dismiss()method for AlertDialog to hide it.Update:
Actually you are inflating View and set it to AlertDialog so you have to close that AlertDialog to hide that inflated View.