ここにリストされている方法を使用して連絡先カードを開こうとしていましたが、どういうわけか連絡先アクティビティが開いた直後に閉じていました。
コンタクト アクティビティが私の古いコンテンツ URI を受け入れていないようです。
適切なコンテンツURIを取得するためgetLookupUri (long contactId, String lookupKey)
のクラスのメソッドを使用してこの問題を解決しましたhttps://developer.android.com/reference/android/provider/ContactsContract.Contacts.html#getLookupUri(long, java.lang.String)ContactsContract.Contacts
したがって、連絡先カードを開くためのコードは次のようになります。
Intent intent = new Intent(Intent.ACTION_VIEW);
String lookupKey = phonesCursor.getString(phonesCursor.getColumnIndexOrThrow(ContactsContract.PhoneLookup.LOOKUP_KEY));
long contactId = phonesCursor.getLong(phonesCursor.getColumnIndexOrThrow(ContactsContract.PhoneLookup._ID));
Uri uri = ContactsContract.Contacts.getLookupUri(contactId, lookupKey);
intent.setData(uri);
startActivity(intent);