mercredi 4 mai 2016

How to read a file and save data in android sqlite database [duplicate]

This question already has an answer here:

I am having some trouble reading a file and saving the data from the file into sqlite db. I get this error:

Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.example.testPreject.bdd.Lien.getLiencomplet() on a null object reference

public class MainActivity extends Activity {
    public void onCreate(Bundle savedInstanceState) {
        LienBDD lienBdd = new LienBDD(this);;
        Lien lienFromBdd = lienBdd.getLienWithTitre("google");
        String test = lienFromBdd.getLiencomplet().toString();


        Toast.makeText(this, test, Toast.LENGTH_LONG).show();

Aucun commentaire:

Enregistrer un commentaire