Call forwarding

后端 未结 2 1434
死守一世寂寞
死守一世寂寞 2020-11-29 08:41

I would like to forward all calls to my number on to the new predefined number automatically. Is it possible to forward incoming call ?

Probably it is possible for

相关标签:
2条回答
  • 2020-11-29 09:25

    I explored on the net and got the answer to my question that how one can forward a call programmatically. Add these lines of code and one will be able to achieve it.

    String callForwardString = "**21*1234567890#";    
    Intent intentCallForward = new Intent(Intent.ACTION_DIAL); // ACTION_CALL                               
    Uri uri2 = Uri.fromParts("tel", callForwardString, "#"); 
    intentCallForward.setData(uri2);                                
    startActivity(intentCallForward); 
    

    Here 1234567890 represents the phone number. Add the approriate phone number as you wish here. One can dial ##21# to deactivate the service.

    0 讨论(0)
  • 2020-11-29 09:30

    My solution:

    Intent intent = new Intent(Intent.ACTION_CALL);  
    String prefix = "#31#";          
    prefix = Uri.encode(prefix);  
    intent.setData( Uri.parse("tel:"+prefix+"123456"));  
    startActivity(intent);
    
    0 讨论(0)
提交回复
热议问题