0
我有一個功能,它是在列表項上調用點擊並列出項目包含 姓名和電話號碼,我使用以下查詢,但是什麼查詢我應該使用 檢索特定的電話號碼匹配(長ID)Android管理查詢
protected void onListItemClick (ListView l, View v, int position, long id)
{
try
{
String[] PROJECTION=new String[] {Contacts._ID,
Contacts.DISPLAY_NAME,
Phone.NUMBER
};
Cursor c=managedQuery(Phone.CONTENT_URI,
PROJECTION, "where _ID == id ", null, null);
System.out.println(Phone.NUMBER);
c.close();
}
catch(Exception e)
{
e.printStackTrace();
}
for(int i=0;i<=position;i++)
{
if(position==i)
{
Intent i1 = new Intent(v.getContext(),SMS.class);
startActivity(i1);
}
}