How to make a phone call button in Android for Marshmallow -
i'm trying create calling button in android. created 1 , works in kind of android device it's not working on marshmallow. don't know why. how create calling button android marshmallow?
this code used calling button :
public void button(view v) { string number = "12354656"; intent intent = new intent(intent.action_call); intent.setdata(uri.parse("tel:" + number)); if (activitycompat.checkselfpermission(this, android.manifest.permission.call_phone) != packagemanager.permission_granted) { return; } startactivity(intent); }
you'll need enable permission app in phone settings. under permissions in settings
Comments
Post a Comment