Android implements simple dialer functions
The manufacturing method of simple dialer is as follows
1、 Layout structure
Construct the layout as shown in the figure
2、 Grant software call permission
Add the following code in androidmanifest.xml
Grant the software the right to make a phone call, otherwise you can't make a phone call
3、 Write code (applicable to Android 6.0 and below)
1) . define an external class to implement the interface type required by setonclicklistener
2) The anonymous inner class implements the interface type required by setonclicklistener
4、 Write code (for Android 6.0 and above)
On Android 6.0 and above platforms, even if the call permission has been added, the runtime will still report an error security exception: the permission is denied. You should check whether the application is granted phone permission when the application starts.
The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.