Source:
<code>private void launchEditTagsDialog(final Context context, final ShortcutsPojo pojo) { AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setTitle(context.getResources().getString(R.string.tags_add_title)); <START> @SuppressLint("InflateParams") final View v = LayoutInflater.from(context).inflate(R.layout.tags_dialog, null); <END> final MultiAutoCompleteTextView tagInput = v.findViewById(R.id.tag_input); ArrayAdapter<String> adapter = new ArrayAdapter<>(context, android.R.layout.simple_dropdown_item_1line, KissApplication.getApplication(context).getDataHandler().getTagsHandler().getAllTagsAsArray()); tagInput.setTokenizer(new SpaceTokenizer()); tagInput.setText(shortcutPojo.getTags()); tagInput.setAdapter(adapter); builder.setView(v); builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); pojo.setTags(tagInput.getText().toString()); KissApplication.getApplication(context).getDataHandler().getTagsHandler().setTags(pojo.id, pojo.getTags()); pojo.displayTags = pojo.getTags(); String msg = context.getResources().getString(R.string.tags_confirmation_added); Toast.makeText(context, msg, Toast.LENGTH_SHORT).show(); } }); builder.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); AlertDialog dialog = builder.create(); dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE); dialog.show(); }</code><technical_language>save</technical_language>

Target:
private void launchEditTagsDialog(final Context context, final ShortcutsPojo pojo) { AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setTitle(context.getResources().getString(R.string.tags_add_title)); final View v = View.inflate(context, R.layout.tags_dialog, null); final MultiAutoCompleteTextView tagInput = v.findViewById(R.id.tag_input); ArrayAdapter<String> adapter = new ArrayAdapter<>(context, android.R.layout.simple_dropdown_item_1line, KissApplication.getApplication(context).getDataHandler().getTagsHandler().getAllTagsAsArray()); tagInput.setTokenizer(new SpaceTokenizer()); tagInput.setText(shortcutPojo.getTags()); tagInput.setAdapter(adapter); builder.setView(v); builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); pojo.setTags(tagInput.getText().toString()); KissApplication.getApplication(context).getDataHandler().getTagsHandler().setTags(pojo.id, pojo.getTags()); pojo.displayTags = pojo.getTags(); String msg = context.getResources().getString(R.string.tags_confirmation_added); Toast.makeText(context, msg, Toast.LENGTH_SHORT).show(); } }); builder.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); AlertDialog dialog = builder.create(); dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE); dialog.show(); }