I am implementing an Android app that will allow users to purchase something by dialing a number from my app pressing a button. In single SIM devices it works nicely, but in dual sim devices, when I run my app and click on the "Purchase Button" a popup window automatically opens to ask me which SIM I want to use to dial (I didn't have to write code for this action, It automatically done by my device. Also when I normally call a friend using the default Phone App of my device this pop up window opens automatically to ask me which Sim I wanna use to dial and after selecting a sim it starts calling), but in case of my app after selecting an SIM , It doesn't work, It doesn't start dialing. But It starts dialing in single sim devices.
I have added <uses-permission android:name="android.permission.CALL_PHONE"></uses-permission>
correctly and my code works nicely on single SIM devices.
So what's the problem? Why it's not working on dual Sim devices?
My code:
Button button1maina = (Button) findViewById(R.id.Button03);
button1maina.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:" + "*566%23"));;
startActivity(callIntent);
}
});