private fun addContactToSim(number:String,name:String) {
try {
val simUri = Uri.parse("content://icc/adn")
val values = ContentValues()
values.put("number", number)
values.put("tag", name)
context.getContentResolver().insert(simUri, values)
}
catch (e:Exception)
{
e.printStackTrace()
}
}
This function I am using to create contact to sim am calling this function in onCreate()
with single contact addContactToSim("MyTestNumber","9028340932") like this but contact is not saving to sim I am unable to see contact in sim please suggest me what I am doing wrong.