newInstance failed: no <init>()
<p>I got 3 files. One serves as a database handler ( insert, delete, update etc... ) and the other maintains the object constructors with its functions. The last file just prints some values after it inserts them to the database.</p>

<p>The error i got is :</p>

<pre><code>12-29 01:54:21.584: D/dalvikvm(574): newInstance failed: no &lt;init&gt;()
12-29 01:54:21.634: D/AndroidRuntime(574): Shutting down VM
12-29 01:54:21.634: W/dalvikvm(574): threadid=1: thread exiting with uncaught exception      (group=0x4001d800)
12-29 01:54:21.724: E/AndroidRuntime(574): FATAL EXCEPTION: main
12-29 01:54:21.724: E/AndroidRuntime(574): **java.lang.RuntimeException: Unable to     instantiate activity ComponentInfo**{org.teo.dbexample/org.teo.dbexample.DbexampleActivity}:     java.lang.InstantiationException: org.teo.dbexample.DbexampleActivity
12-29 01:54:21.724: E/AndroidRuntime(574):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)
12-29 01:54:21.724: E/AndroidRuntime(574):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
12-29 01:54:21.724: E/AndroidRuntime(574):  at android.app.ActivityThread.access$2300(ActivityThread.java:125)
12-29 01:54:21.724: E/AndroidRuntime(574):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
12-29 01:54:21.724: E/AndroidRuntime(574):  at android.os.Handler.dispatchMessage(Handler.java:99)
12-29 01:54:21.724: E/AndroidRuntime(574):  at android.os.Looper.loop(Looper.java:123)
12-29 01:54:21.724: E/AndroidRuntime(574):  at android.app.ActivityThread.main(ActivityThread.java:4627)
12-29 01:54:21.724: E/AndroidRuntime(574):  at java.lang.reflect.Method.invokeNative(Native Method)
12-29 01:54:21.724: E/AndroidRuntime(574):  at java.lang.reflect.Method.invoke(Method.java:521)
12-29 01:54:21.724: E/AndroidRuntime(574):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
12-29 01:54:21.724: E/AndroidRuntime(574):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
12-29 01:54:21.724: E/AndroidRuntime(574):  at dalvik.system.NativeStart.main(Native Method)
12-29 01:54:21.724: E/AndroidRuntime(574): **Caused by:**java.lang.InstantiationException: org.teo.dbexample.DbexampleActivity
12-29 01:54:21.724: E/AndroidRuntime(574):  at java.lang.Class.newInstanceImpl(Native Method)
12-29 01:54:21.724: E/AndroidRuntime(574):  at java.lang.Class.newInstance(Class.java:1429)      
12-29 01:54:21.724: E/AndroidRuntime(574):  at  android.app.Instrumentation.newActivity(Instrumentation.java:1021)   
12-29 01:54:21.724: E/AndroidRuntime(574):  at  android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
12-29 01:54:21.724: E/AndroidRuntime(574):  ... 11 more
</code></pre>

<p><strong>Constructors :</strong></p>

<pre><code>package org.teo.dbexample;

public class Contact {

    //private variables
    int _id;
    String _name;
    String _phone_number;

    // Empty constructor
    public Contact(){

    }
    // constructor
    public Contact(int id, String name, String _phone_number){
        this._id = id;
        this._name = name;
        this._phone_number = _phone_number;
    }

    // constructor
    public Contact(String name, String _phone_number){
        this._name = name;
        this._phone_number = _phone_number;
    }
</code></pre>

<p><strong>DataBase Handler file :</strong></p>

<pre><code>public class DbexampleActivity extends SQLiteOpenHelper {

/**
 *  Create a db with Table=Contact and Fields = id, name, phone_number
 */


// Database Version
private static final int DATABASE_VERSION = 1;

// Database Name
private static final String DATABASE_NAME = "contactsManager";

// Contacts table name
private static final String TABLE_NAME = "contacts";

// Contacts Table Columns names
private static final String _ID = "id";
private static final String NAME = "name";
private static final String PHONE = "phone_number";


public DbexampleActivity(Context context) {                     
    super(context, DATABASE_NAME, null, DATABASE_VERSION);
}
</code></pre>
