Hello,
I'm having an issue with WifiManager on the G1. I think the issue has
more to do with Intents, BroadcastReceivers, Activities, and other
things I'm unfamiliar with the language of.
1. I have a ListActivity derived class which is what loads on startup
of the app.
2. A class member is a WifiManager, which calls WifiManager.startScan
().
3. I've tried to create an intent, but onActivityResult is never
called:
Intent mIntent = new Intent("android.net.wifi.SCAN_RESULTS");
setResult(RESULT_OK, mIntent);
//The result of startScan may be false if it won't run properly.
// If it does, you want to execute the Intent so that there is a
response.
if(mManager.startScan()){
Log.i(this.toString(), "Scan started successfully.");
// startActivityForResult(mIntent, COMPLETED_SCAN);
}
4. I set up a BroadcastReceiver to handle the
'android.net.wifi.SCAN_RESULTS' action, and the onReceive handler is
called. The problem here is that onReceive is a function of a
BroadcastReciever derived class.
Which way is the proper way to handle actions? How can I read in
ScanResults asynchronously? If I use the BroadcastReceiver, how can I
send data back to the ListActivity so that the data can be displayed?
Am I approaching this properly?
Thanks,
Benry
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---