private void initDatabase() { mDatabaseHelper = new DatabaseHelper(this); try { mDatabaseHelper.openDatabase(); } catch (Exception e) { e.printStackTrace(); DialogAlertFragment dialogError = DialogAlertFragment.newInstance("Error al acceder a la Base de datos"); dialogError.setOnClickListener(this); dialogError.show(getSupportFragmentManager(), "dialogError"); } }
@Override public void onClick(View v) { Log.i(TAG, "onClick"); if (v.getId() == mTextViewSalir.getId()) { finish(); } else { if (mOfficeSelected > 0) { Intent intent = new Intent(this, QuestionsActivity.class); intent.putExtra("officeSelected", mOfficeSelected); startActivity(intent); } else { DialogAlertFragment dialogError = DialogAlertFragment.newInstance("Debe Seleccionar una oficina del mapa"); dialogError.show(getSupportFragmentManager(), "dialogErrorMap"); } } }