how can i get the resultcode from an activity?
<p>I have one checkbox which creates a Bluetooth connection. The problems is that when the bluetooth permission request dialog box appears and i choose "No", the checkbox still remains checked.How could i get the requestcode from this activity, and put the checkbox to off if i get RESULT_CANCELED?</p>

<pre><code>CheckBox turnBtOnOff=(CheckBox)findViewById(R.id.checkBox1);
        turnBtOnOff.setOnCheckedChangeListener(new OnCheckedChangeListener()
        {
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked)
            {
                if (isChecked)
                {

                    if(!mBluetoothAdapter.isEnabled()){
                        Intent enableBtIntent=new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
                        startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);


                        //myAddress=mBluetoothAdapter.getAddress();
                        //Toast.makeText(getBaseContext(), myAddress, Toast.LENGTH_SHORT).show();

                    }
                }
                else
                {
                    if(mBluetoothAdapter.isEnabled()){
                        mBluetoothAdapter.disable();
                    }
                }


            }
        });
</code></pre>
