Sending message automatically in Dual Sim

你离开我真会死。 提交于 2020-01-25 17:37:53

问题


I am developing an app that requires sending messages automatically for hardware button press. It is working nice in single SIM phone, but not in dual SIM. So is there any way to set the default SIM while sending message or making a voice call programmatically when using dual SIM phones?


回答1:


ContentValues val = new ContentValues();
val.put("value", "here goes the preferred SIM ID");
getContentResolver().update(Uri.parse("content://settings/system"), val, "name='sms_sim_setting'", null);

This portion of code is working nice for me.This can be extended for other SIM selection scenarios. Setting cache contains entry with name S, voice_call_sim_setting, gprs_connection_sim_setting, video_call_sim_setting etc.But it requires users permission to write settings. --from Janaka Bandara



来源:https://stackoverflow.com/questions/30379442/sending-message-automatically-in-dual-sim

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