Hi Everyone,

My app requires a network connection so if they don't have one enabled
I prompt them to start it.  I do this by calling the Wireless &
Network settings Activity as such:

startActivityForResult(new
Intent(android.provider.Settings.ACTION_WIRELESS_SETTINGS),
NETWORK_RESULT);

However, when I run my app in the debugger, onActivityResult is called
immediately as my calling activity is exited when it should be called
once the settings menu if exited.  This premature call also sends a
resultCode of Activity.RESULT_CANCEL.  Here is the code from
onActivityResult:

if (resultCode == Activity.RESULT_OK) {
                switch (requestCode) {
                case NETWORK_RESULT:
                        if (!mobileInfo.isConnected() && 
!wifiInfo.isConnected())
                                noNetwork();
                        else
                                do_something();
                }
}

Does anyone know if I'm doing something wrong?  If I understand this
correctly, onActivityResult should be the callback to when the
Wireless & Network Settings activity exits.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to