Activity crash when using sqllite in my custom class - android
<p>So i created this class :</p>

<pre><code>public class Database extends Activity {
    public SQLiteDatabase db ;

    public void openDb(){
        db = openOrCreateDatabase("myDB",MODE_PRIVATE,null);
        db.close();
    }   
}
</code></pre>

<p>And in my main activity i wrote that : </p>

<pre><code>public class Splash extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.splash);
        Database ODB= new Database ();
        ODB.openDb();

    }
}
</code></pre>

<p>When I launch that I get force closing windows and when I put that in try-catch I get <code>NullPointerException</code> .</p>

<p>Does anyone know what I am doing wrong?</p>
