我正在使用eclipse for android我的API级别为8,我尝试了project-> properties-> android->但是在这里它只显示了API级别8的一个复选框.请指导我做什么?
当我尝试打开eclipse它时,它会显示一个错误,即Android SDK content Loader has encountered a problem.parseSdkContent failed
当我点击详细信息按钮时,它会显示给我parseSdkContent failed java.lang.NullPointeException.
当我尝试创建AVD时,它显示错误,Location of the android SDK has not been setup in the preferences而我已经在首选项中设置了路径.
请帮我.由于这个问题,我的工作正在等待中.
以下是我的代码,实际上在屏幕上它没有向我显示任何联系.在模拟器中我添加了5个联系人.请告诉我该怎么办.
{
//some code
Cursor cur = getContacts();
String[] fields = new String[] {ContactsContract.Data.DISPLAY_NAME};
SimpleCursorAdapter adapter =
new SimpleCursorAdapter(this,
R.layout.list_view_item_new,
cur,
fields,
new int[] {R.id.contactEntryText});
lv.setAdapter(adapter);
}
private Cursor getContacts() {
// Run query
Uri uri = ContactsContract.Contacts.CONTENT_URI;
String[] projection =
new String[]{ ContactsContract.Contacts._ID,
ContactsContract.Contacts.DISPLAY_NAME };
String selection = null;
String[] selectionArgs = null;
String sortOrder = ContactsContract.Contacts.DISPLAY_NAME +
" COLLATE LOCALIZED ASC";
return managedQuery(uri, projection, selection, selectionArgs, sortOrder);
}
Run Code Online (Sandbox Code Playgroud)