我想在操作栏的标签上的SherlockFragmentList上显示联系人列表。我按照android develop tutorial但我在尝试获取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);
}
这里有什么帮助吗? 感谢
答案 0 :(得分:6)