Make Call in Android Application using default call application

前端 未结 3 1682
无人及你
无人及你 2020-12-11 03:32

I am using following code to make a call from my android application:

Intent intent = new Intent(Intent.ACTION_CALL);                 
intent.setData(Uri.par         


        
3条回答
  •  清歌不尽
    2020-12-11 04:06

    Use intent.setPackage("com.android.phone");

    Like

    Intent intent = new Intent(Intent.ACTION_CALL);  
    intent.setPackage("com.android.phone");               
    intent.setData(Uri.parse("tel:9898989898"));
    startActivity(intent);
    

    But better is to let the user to choose.

    Read more at How to call from Android Native Dialers, ignore other dialers

提交回复
热议问题