Код: Выделить всё
inflador = li.inflate(R.layout.dialogo_estandar, null);
MensajeDialogoTV = (TextView) inflador.findViewById(R.id.dialogoEstandarTV);
MensajeDialogoTV.setTextSize(tamanoTexto);
MensajeDialogoTV.setText(miActividad.getResources().getString(R.string.ac_dialogos_06));
ventana = new AlertDialog.Builder(miActividad);
ventana.setIcon(R.drawable.icono_info);
ventana.setTitle(miActividad.getResources().getString(R.string.ac_dialogos_05));
ventana.setView(inflador);
ventana.setPositiveButton(miActividad.getResources().getString(R.string.estandar_SI), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int boton) {
finish();
miActividad.finish();
}
});
ventana.setNegativeButton(miActividad.getResources().getString(R.string.estandar_NO), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int boton) {
Intent RTReturn = new Intent(PrincipalActivity.BROADCAST_REINICIA_CRONO);
LocalBroadcastManager.getInstance(miActividad).sendBroadcast(RTReturn);
}
});
return ventana.create();
< /code>
Тогда, в Call Activity Принципиально. int PASOS_POR_EL_RECEIVER = 1;
static final String BROADCAST_REINICIA_CRONO = "REINICIA_CRONO_BROADCAST";
private BroadcastReceiver broadcastReceiver = new BroadcastReceiver()
{
@Override
public void onReceive(Context context, Intent intent)
{
if(intent.getAction().equals(BROADCAST_REINICIA_CRONO))
{
Log.e("TONI-LOG", "PASANDO POR EL RECEIVER " + PASOS_POR_EL_RECEIVER++ + " VECES.");
broadcastManager.unregisterReceiver(broadcastReceiver);
}
}
};
< /code>
И я называю диалоговое окно из этого действия, как это ... < /p>
broadcastManager.registerReceiver(broadcastReceiver, intentFilter);
Dialogos Dialog = new Dialogos();
Dialog.Dialogo1(this, DIALOGO_INTERRUMPIR_TEST, TamanoTexto1, 0, null, tipoDispositivo);
Подробнее здесь: https://stackoverflow.com/questions/338 ... t-shouldnt