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"); } }
private void initLocation() { Log.i(TAG, "initLocation"); List<Map<String, String>> resultOficinas = mDatabaseHelper.getSelectQueryMapValues(DatabaseConstant.QUERY_OFICINAS, null); mOficinasBeanList = CommonBeanUtils.getDataList(resultOficinas, OficinasBean.class); mGoogleApiClient = new GoogleApiClient.Builder(this) .addConnectionCallbacks(this) .addOnConnectionFailedListener(this) .addApi(LocationServices.API) .build(); }