• 3
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191

Backtrace:

File: /home/prodcxja/public_html/questions/application/views/question.php
Line: 191
Function: _error_handler

File: /home/prodcxja/public_html/questions/application/controllers/Questions.php
Line: 433
Function: view

File: /home/prodcxja/public_html/questions/index.php
Line: 315
Function: require_once

name Punditsdkoslkdosdkoskdo

Call forwarding is not working by using below code

When I try to forward call by this code nothing happened. I want call forward call on specific number. Please help me.

callforward("**21*MobileNo");// While incoming call.

private void callforward(String callForwardString) {


        PhoneCallListener phoneListener = new PhoneCallListener();
        TelephonyManager telephonyManager = (TelephonyManager)
                ctx.getSystemService(Context.TELEPHONY_SERVICE);
        telephonyManager.listen(phoneListener, PhoneStateListener.LISTEN_CALL_STATE);
        Intent intentCallForward = new Intent(Intent.ACTION_CALL);
        Uri mmiCode = Uri.fromParts("tel", callForwardString, ("#"));
        intentCallForward.setData(mmiCode);
        System.out.println("Call FWD Number:"+callForwardString);
        if (ActivityCompat.checkSelfPermission(ctx, Manifest.permission.CALL_PHONE) != PackageManager.PERMISSION_GRANTED) {
            // TODO: Consider calling
            //    ActivityCompat#requestPermissions
            // here to request the missing permissions, and then overriding
            //   public void onRequestPermissionsResult(int requestCode, String[] permissions,
            //                                          int[] grantResults)
            // to handle the case where the user grants the permission. See the documentation
            // for ActivityCompat#requestPermissions for more details.
            return;
        }
        ctx.startActivity(intentCallForward);



    }
    • Have checked permission in app setting? You should request permission Manifest.permission.CALL_PHONE if not there.

It should actually be pass # at the end of the mobile no.

callforward("**21*MobileNo#");// While incoming call.

// For the emulator, you have to pass **21*5556#.

Here # is more important to forwarding call.

  • 1
Reply Report