mercredi 20 janvier 2016

Error: Not an enclosing class Android Studio

   public import_fragment.Contact getContact(int id) {
    SQLiteDatabase db = getReadableDatabase();

    Cursor cursor = db.query(TABLE_CONTACTS, new String[] { KEY_ID, KEY_NAME, KEY_PHONE, KEY_EMAIL, KEY_ADDRESS, KEY_IMAGEURI }, KEY_ID + "=?", new String[] { String.valueOf(id) }, null, null, null, null );

    if (cursor != null)
        cursor.moveToFirst();

    import_fragment.Contact contact = new Contact(Integer.parseInt(cursor.getString(0)), cursor.getString(1), cursor.getString(2), cursor.getString(3), cursor.getString(4), Uri.parse(cursor.getString(5)));
    db.close();
    cursor.close();
    return contact;
}

When i try to change 'Contact' to import_fragment.Contact i get error in this line:new import_fragment.Contact(Integer.parseInt(cursor.getString(0)), cursor.getString(1), cursor.getString(2), cursor.getString(3), cursor.getString(4), Uri.parse(cursor.getString(5)));

error say com.al3almya.users.al3almya.import_fragment is not an en closing class

Aucun commentaire:

Enregistrer un commentaire