2
我的應用程序顯示一個聯繫人列表,我已經驗證(在代碼中)對每個聯繫人至少有一個聚合建議。 一旦用戶點擊了其中一個聯繫人,我想打開內置活動/屏幕,詢問用戶他想加入所選聯繫人的聯繫人。直接啓動Android的聯繫人的聚合建議屏幕
部分基於this example,我試圖運行這段代碼:
@Override
protected void onListItemClick(ListView l, View v, int position, long id)
{
ContactInfo selectedValue = (ContactInfo) getListAdapter().getItem(position);
/*Should give URI for Aggregation suggestion*/
Uri uri = Contacts.CONTENT_URI.buildUpon()
.appendEncodedPath(String.valueOf(selectedValue.getId()))
.appendPath(Contacts.AggregationSuggestions.CONTENT_DIRECTORY)
.appendQueryParameter("limit", "3")
.build();
/*Opens Activity*/
Intent openContactDetailsIntent = new Intent(Intent.ACTION_VIEW);
openContactDetailsIntent.setData(uri);
startActivity(openContactDetailsIntent);
}
然而,所發生的一切,就是一般的接觸屏幕被打開,所有的聯繫人列表 - 而不是建議只接觸。
這可能嗎?我是否將正確的論點傳遞給正確的活動?