Samsung android 6.0 how to get dual sim call logs with sim slot id?

北城余情 提交于 2019-12-12 09:11:23

问题


Samsung(dual sim) before offical android 6.0(not cm) device, I could get call logs with sim slot id, but Samsung(dual sim) android 6.0+ device I get an issue:

String  slotId = cursor.getString(cursor.getColumnIndex(CallLog.Calls.PHONE_ACCOUNT_ID));

<i>slotId</i> = null; but in another device (Huawei mate 8) is work fine

Did samsung modify the com.android.providers.contacts and contacts2.db?

Can someone guide through the solution for this?


回答1:


Update news : I find one solution

  boolean s_bSamsung;
if (Build.VERSION_CODES.M <= Build.VERSION.SDK_INT && s_bSamsung){
   uri = Uri.parse("content://logs/call");
}else {
  uri = Uri.parse(CallLog.Calls.CONTENT_URI);
}

use sim_id find sim slot



来源:https://stackoverflow.com/questions/36711454/samsung-android-6-0-how-to-get-dual-sim-call-logs-with-sim-slot-id

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!