I'm trying to find a way to create a popup screen for some user input which includes radio button, editText, button. I don't want to start a new activity. what would be a good option? AlertDialog? Spinner?Popup menu? Thanks
AlertDialog would be fine for this. You can declare a layout.xml file with all of the components you'll need and then inflate it and set it as the content of your dialog.
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View layout = inflater.inflate(R.layout.yourLayoutId, (ViewGroup) findViewById(R.id.yourLayoutRoot));
AlertDialog.Builder builder = new AlertDialog.Builder(this)
.setView(layout);
AlertDialog alertDialog = builder.create();
alertDialog.show();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With