jak pobrać dane z bazy danych sqlite i pokazać w widoku listy w systemie Android

po stronie logowania chcę pokazać A dla Apple, B for Boy .... ect upto F..in listview. Ale w mojej aplikacji sukces logowania w pełni tylko tabela logowania jest tworzona sukces w pełni, ale mainmenu nie jest tworzony .. Chcę utworzyć tabelę głównego menu w testowej bazie danych, po czym chcę pobrać dane z głównej tabeli do widoku listy w systemie Android

<code>      i try this code
      if(username.length()>0&&password.length()>0)
        {
            SQLiteAdapter db=new SQLiteAdapter(Main.this);
            db.openToWrite();
            if(db.Login(username,password))
            {
                System.out.println("goutham");
                Intent intent=new Intent(getApplicationContext(),ExampleActivity.class);

                startActivity(intent);
            } 
</code>

SQLiteAdapter.java

<code>           public class SQLiteAdapter {

public static final String MYDATABASE_NAME = "test";
public static final String KEY_USERNAME = "username";
public static final String KEY_PASSWORD = "password";
public static final String MYDATABASE_TABLE = "mainmenu";
private static final String DATABASE_TABLE = "login";
public static final int MYDATABASE_VERSION = 1;
public static final String KEY_ID = "_id";
public static final String KEY_CONTENT = "Content";

// create table MY_DATABASE (ID integer primary key, Content text not null);
private static final String SCRIPT_CREATE_DATABASE = "create table "
        + MYDATABASE_TABLE + " (" + KEY_ID
        + " integer primary key autoincrement, " + KEY_CONTENT
        + " text not null);";
private static final String DATABASE_CREATE = "create table login (_id integer primary key autoincrement, "
        + "username text not null, " + "password text not null);";

private SQLiteHelper sqLiteHelper;
private SQLiteDatabase sqLiteDatabase;

private Context context;

public SQLiteAdapter(Context c) {
    context = c;
}

public SQLiteAdapter openToRead() throws android.database.SQLException {
    sqLiteHelper = new SQLiteHelper(context, MYDATABASE_NAME, null,
            MYDATABASE_VERSION);
    sqLiteDatabase = sqLiteHelper.getReadableDatabase();
    return this;
}

public SQLiteAdapter openToWrite() throws android.database.SQLException {
    sqLiteHelper = new SQLiteHelper(context, MYDATABASE_NAME, null,
            MYDATABASE_VERSION);
    sqLiteDatabase = sqLiteHelper.getWritableDatabase();
    return this;
}

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

public long insert(String content) {

    ContentValues contentValues = new ContentValues();
    contentValues.put(KEY_CONTENT, content);
    return sqLiteDatabase.insert(MYDATABASE_TABLE, null, contentValues);
}

public int deleteAll() {
    return sqLiteDatabase.delete(MYDATABASE_TABLE, null, null);

}

public Cursor queueAll() {
    String[] columns = new String[] { KEY_ID, KEY_CONTENT };
    Cursor cursor = sqLiteDatabase.query(MYDATABASE_TABLE, columns, null,
            null, null, null, null);

    return cursor;
}

private static class SQLiteHelper extends SQLiteOpenHelper {

    public SQLiteHelper(Context context, String name,
            CursorFactory factory, int version) {
        super(context, name, factory, version);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        // TODO Auto-generated method stub
        db.execSQL(SCRIPT_CREATE_DATABASE);
        db.execSQL(DATABASE_CREATE);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        // TODO Auto-generated method stub

    }

}

public long AddUser(String username, String password) {
    ContentValues initialValues = new ContentValues();
    initialValues.put(KEY_USERNAME, username);
    initialValues.put(KEY_PASSWORD, password);
    return sqLiteDatabase.insert(DATABASE_TABLE, null, initialValues);

}

public boolean Login(String username, String password) {
    // TODO Auto-generated method stub
    Cursor mCursor = sqLiteDatabase.rawQuery("SELECT * FROM "
            + DATABASE_TABLE + " WHERE username=? AND password=?",
            new String[] { username, password });
    if (mCursor != null) {
        if (mCursor.getCount() > 0) {
            return true;
        }
    }
    return false;
}

 }
</code>

ExampleActivity.java

<code>                 public class ExampleActivity extends Activity {
private SQLiteAdapter mySQLiteAdapter;

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    ListView listContent = (ListView) findViewById(R.id.contentlist);

    /*
     * Create/Open a SQLite database and fill with dummy content and close
     * it
     */
    mySQLiteAdapter = new SQLiteAdapter(this);
    mySQLiteAdapter.openToWrite();
    // mySQLiteAdapter.deleteAll();

    mySQLiteAdapter.insert("A for Apply");
    mySQLiteAdapter.insert("B for Boy");
    mySQLiteAdapter.insert("C for Cat");
    mySQLiteAdapter.insert("D for Dog");
    mySQLiteAdapter.insert("E for Egg");
    mySQLiteAdapter.insert("F for Fish");

    mySQLiteAdapter.close();

    /*
     * Open the same SQLite database and read all it's content.
     */
    mySQLiteAdapter = new SQLiteAdapter(this);
    mySQLiteAdapter.openToRead();

    Cursor cursor = mySQLiteAdapter.queueAll();
    startManagingCursor(cursor);

    String[] from = new String[] { SQLiteAdapter.KEY_CONTENT };
    int[] to = new int[] { R.id.text };

    SimpleCursorAdapter cursorAdapter = new SimpleCursorAdapter(this,
            R.layout.row, cursor, from, to);

    listContent.setAdapter(cursorAdapter);

    mySQLiteAdapter.close();

}
</code>

}

po uruchomieniu programu tabela logowania jest tworzona tylko w bazie danych, ale tabela głównego menu nie jest tworzona w programie uruchomieniowym database.after, wyświetla błąd taki jak sqlite zwrócony kod = 1 brak takiej tabeli w MY_TABLE

questionAnswers(1)

yourAnswerToTheQuestion