Increase Ringer Volume on incoming call of certain contact. Android
<p>Right now i have my contact picker returning the phonenumber of the contact. Im trying to match that number with the incoming call number so if it is equal it increases the volume to max. I can't quite get it. Any Help??</p>

<p>Here is my Code so Far. "number" is the returned number from my contact picker.</p>

<pre><code>public class phoneStateListener extends PhoneStateListener {

    public void onCallStateChanged(int state, String incomingNumber){


            switch(state){
                    case TelephonyManager.CALL_STATE_RINGING:

                            break;
            }       

 }

 public class broadCastReceiver extends BroadcastReceiver {

    public void onReceive(Context context, Intent intent) {

        TelephonyManager telephony = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
            PhoneStateListener PhoneListener = new PhoneStateListener();

        telephony.listen(PhoneListener, PhoneStateListener.LISTEN_CALL_STATE);


        Bundle bundle = intent.getExtras();
        String phoneNr= bundle.getString("incoming_number");


        if (phoneNr == number){

            amanager.setStreamVolume(AudioManager.STREAM_RING, 7, AudioManager.FLAG_ALLOW_RINGER_MODES|AudioManager.FLAG_PLAY_SOUND);

        }

    }
</code></pre>
