why my first created row in database have id null1
<p>my problem is, when I put something in my text fields and save that to database, the ID of that row is null1
instead of 1
here is my code for creating database and putting data in database :</p>

<pre><code>    private HelperDb myHelper;
    private final Context myContext;
    private SQLiteDatabase myDatabase;
    private static class HelperDb extends SQLiteOpenHelper {

    public HelperDb(Context context) {
        super(context, DATABASE_NAME, null, 1);
        // TODO Auto-generated constructor stub
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        // TODO Auto-generated method stub
        db.execSQL("CREATE TABLE " + DATABASE_TABLE + " (" +
        KEY_ROWID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
        KEY_NAME + " STRING, " +
        KEY_TEKST + " TEXT, " +
        KEY_DATUM + " STRING, " +
        KEY_VREME + " STRING);"
                );


    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        // TODO Auto-generated method stub
        db.execSQL("DROP TABLE IF EXISTS " + DATABASE_TABLE);
        this.onCreate(db);

    }

}

public Baza(Context c){
    myContext = c;
}

public Baza open() throws SQLException {
    myHelper = new HelperDb(myContext);
    myDatabase = myHelper.getWritableDatabase();
    return this;
}

public void close() {
    myHelper.close();
}

// this is how I put data in database
public long unesiPodatkeBaza(String ime, String napisaniTekst, String uneseniDatum, String unesenoVreme) {
    // TODO Auto-generated method stub
    ContentValues cv = new ContentValues();
    cv.put(KEY_NAME, ime);
    cv.put(KEY_TEKST, napisaniTekst);
    cv.put(KEY_DATUM, uneseniDatum);
    cv.put(KEY_VREME, unesenoVreme);

    return myDatabase.insert(DATABASE_TABLE, null, cv);

}
</code></pre>

<p>later that make problem for application.</p>

<p>This is how I collect data from database:</p>

<pre><code>public String[] getData() {

    String[] kolone = new String[]{KEY_ROWID, KEY_NAME, KEY_TEKST, KEY_DATUM, KEY_VREME};

    Cursor c = myDatabase.query(DATABASE_TABLE, kolone, null, null, null, null, null);

    iRed = c.getColumnIndex(KEY_ROWID);
    iIme = c.getColumnIndex(KEY_NAME);
    iTekst = c.getColumnIndex(KEY_TEKST);
    iDatum = c.getColumnIndex(KEY_DATUM);
    iVreme = c.getColumnIndex(KEY_VREME);

    for(c.moveToFirst(); !c.isAfterLast(); c.moveToNext()){
        result = result + c.getString(iRed) + " " + c.getString(iIme) + " " + c.getString(iTekst) + " " + c.getString(iDatum) + " " + c.getString(iVreme) + "\n";
    }

    return result.split("\n");
}
</code></pre>

<p>and this is what I'm doing with data:</p>

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

    public String[] data;
    private ListView lv;
    private int idSend;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        setContentView(R.layout.pregledbaze);

        lv = (ListView) findViewById(R.id.lvListaBaza);

        final Baza izlistavanje = new Baza(this);
        izlistavanje.open();
        data = izlistavanje.getData();
        izlistavanje.close();


        lv.setAdapter(new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, data));

        lv.setOnItemClickListener(new OnItemClickListener() {
            public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id){

                String tmplv = lv.getItemAtPosition(position).toString();
                String[] odvojeni = tmplv.split(" ");

                idSend = Integer.parseInt(odvojeni[0]);

                AlertDialog.Builder adb = new AlertDialog.Builder(SQLPregled.this);
                adb.setTitle("Dali zelite da obrisete izabranu poruku?");
                adb.setMessage("Id je : " + odvojeni[0]);
                adb.setPositiveButton("Obrisi", new DialogInterface.OnClickListener() {

                    public void onClick(DialogInterface dialog, int which) {
                        // TODO Auto-generated method stub
                        izlistavanje.open();
                        izlistavanje.deleteData(idSend); 
                        izlistavanje.close();
                        onCreate(null); 

                    }
                }); 

                adb.setNegativeButton("Odustani", new DialogInterface.OnClickListener() {

                    public void onClick(DialogInterface dialog, int which) {
                        // TODO Auto-generated method stub
                        dialog.cancel(); 
                    }
                });

                adb.show(); 
            }

        }); 

    } // onCreate

}
</code></pre>
