1

Tengo un fragments realizado con android studio (el que viene por defecto Navigation Drawer). También tengo una sql en una clase llamada DBHelper. El código del fragmentes esta bien (por defecto), pero cuando quiero referenciar a la clase DBHelper como en este código el this del FSDbHelper dbdivlectura = new FSDbHelper(this); me sale un error.

¿Como lo puedo quitar o que hay que hacer para poder manejar la clase de sqlitel en un fragmenst?

  @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    // Inflate the layout for this fragment

    vista = inflater.inflate(R.layout.fragment_divisiones, container, false);
//  answerText = (View) vista.findViewById(R.id.act);
//  answerText.setText("Cambiado");


    FSDbHelper dbdivlectura = new FSDbHelper(this);
    SQLiteDatabase databasedias = dbdivlectura.getReadableDatabase();



    return vista;
}

0

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Examina otras preguntas con la etiqueta o formula tu propia pregunta.