我想在操作栏中的选项卡上的 SherlockFragmentList 上显示联系人列表。我遵循android开发教程 ,但是当我尝试在onItemClick方法中获取id值时出现以下错误:(方法getLong(int)对于ContactListFragment类型未定义)
public class ContactListFragment extends SherlockListFragment implements LoaderCallbacks<Cursor>,
AdapterView.OnItemClickListener {
@Override
public void onItemClick(AdapterView<?> parent, View item, int position, long rowID) {
//Get The Cursor
Cursor cursor = ((SimpleCursorAdapter) parent.getAdapter()).getCursor();
//move to the selected contact
cursor.moveToPosition(position);
//get the id value
mContactId = getLong(CONTACT_ID_INDEX);
mContactKey = getString(LOOKUP_KEY_INDEX);
mContactUri = Contacts.getLookupUri(mContactId, mcontactKey);
}
这里有什么帮助吗?谢谢