Note that there are some explanatory texts on larger screens.

plurals
  1. POafter to close a dialog, the keyboard do not dissappear
    primarykey
    data
    text
    <p>hello i have an activity and i call a dialog from it. When the dialog appears i write something in an edittext and i click in the save button... the problem is that after to close the dialog and comeback to the activity the keyboard remains there¡¡ </p> <p>i have tried to do this solutions:</p> <p>a) in the layout (xml): </p> <pre><code>android:imeOptions="actionDone" </code></pre> <p>b) in the layout (xml):</p> <pre><code>android:focusable="true" android:focusableInTouchMode="true" </code></pre> <p>c) in the manifest:</p> <pre><code>android:windowSoftInputMode="stateHidden" </code></pre> <p>but this do not work...the keyboard do not dissappear after to dismiss the dialog.</p> <p>some clue please to solve my problem?</p> <p>my dialog code:</p> <pre><code>public class DialogCreamodListas extends Dialog implements OnClickListener { static EditText etxLISTArecep; static EditText etxPRESUPUESTOrecep; ImageView mImageViewImagen1; ImageView mImageViewImagen2; Button btnAceptar; Context mContext; static Long ID_LISTA; static DbAdapter mDbHelper; public DialogCreamodListas(Context context, long ID_LISTA, DbAdapter mDbHelper){ super(context); mContext = context; LayoutInflater inflater = LayoutInflater.from(mContext); final View view = inflater .inflate(R.layout.dialogcreamodlist, null); setContentView(view); DialogCreamodListas.ID_LISTA = (long) ID_LISTA; DialogCreamodListas.mDbHelper = mDbHelper; this.setTitle("Crea o modifica una lista"); mImageViewImagen1 = (ImageView) this.findViewById(R.id.image1); mImageViewImagen1.setImageResource(R.drawable.mascarrito); mImageViewImagen2 = (ImageView) this.findViewById(R.id.image2); mImageViewImagen2.setImageResource(R.drawable.edit2); etxLISTArecep = (EditText) findViewById(R.id.etxNombreLista); etxPRESUPUESTOrecep = (EditText) findViewById(R.id.etxPresupuesto); CargaInformacion(); btnAceptar = (Button) findViewById(R.id.btn_aceptar); btnAceptar.setOnClickListener(this); } private void CargaInformacion() { if(ID_LISTA != null &amp;&amp; ID_LISTA != -1) { Cursor Lista = mDbHelper.RecuperaRegistros(DbAdapter.TABLA_LISTAS,ID_LISTA); ((Activity) mContext).startManagingCursor(Lista); etxLISTArecep.setText(Lista.getString(Lista.getColumnIndexOrThrow(DbAdapter.LISTA))); etxPRESUPUESTOrecep.setText(Lista.getString(Lista.getColumnIndexOrThrow(DbAdapter.PRESUPUESTO))); } } public void onClick(View v) { if (v == btnAceptar) { //AQUI RECUPERO LOS DATOS Y ALMACENO EN BBDD GuardaDatos(); CargarDatos(); dismiss(); return; } } public static void GuardaDatos() { try { String[] Valores; if(ID_LISTA == null || ID_LISTA == -1) { Valores = new String[]{null,etxLISTArecep.getText().toString(),etxPRESUPUESTOrecep.getText().toString()}; long id= mDbHelper.creaRegistro(DbAdapter.TABLA_LISTAS,Valores); if(id&gt;0) { ID_LISTA=id; } } else { Valores = new String[]{ID_LISTA.toString(),etxLISTArecep.getText().toString(),etxPRESUPUESTOrecep.getText().toString()}; mDbHelper.actualizaRegistro(DbAdapter.TABLA_LISTAS,Valores); } } catch(Exception E) { Log.e("EditaListas","Error: "+E); } } public void CargarDatos() { if (this.mContext instanceof AdminListas) { ((AdminListas) this.mContext).CargaDatos(); } else { Cursor ListaCursor= mDbHelper.RecuperaRegistrosTabla(DbAdapter.VISTA_LISTAS); ((Activity) this.mContext).startManagingCursor(ListaCursor); String[] Origen = new String[]{DbAdapter.LISTA,DbAdapter.PRESUPUESTO,DbAdapter.ARTICULOS,DbAdapter.DIFERENCIA}; int [] Destino = new int[]{R.id.txvnombrelista,R.id.txvpresupuesto,R.id.txvarticulos,R.id.txvdiferencia}; SimpleCursorAdapter listas = new SimpleCursorAdapter(this.getContext(),R.layout.registrodetallelista,ListaCursor,Origen,Destino); ((ListActivity) this.mContext).setListAdapter(listas); } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload