Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4362: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4364: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4365: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4366: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
anddev.org • View topic - Check bluetooth status from library.

Check bluetooth status from library.

Problems with WiFi, SQLite ,Bluetooth, WiMax, Proxies, etc...

Check bluetooth status from library.

Postby mmenaker » Wed Oct 28, 2009 11:12 pm

Hi,

I have a library that is used by activities, but isn't an activity itself. So it doesn't have a context.

However I need to check if bluetooth is enable:

String BTstatus = android.provider.Settings.Secure.getString(getContentResolver(),
android.provider.Settings.Secure.BLUETOOTH_ON);

if(BTstatus.equalsIgnoreCase("1"))
{
...
}
else
{
...
}

However without a context, I can't seem to find a way to get the content resolver.

Is there any static functions I could use to get this?

I really don't want to have to have the activity pass the context down through numerous classes.

Thanks.
mmenaker
Freshman
Freshman
 
Posts: 6
Joined: Thu Jun 04, 2009 11:15 pm

Top

Return to Networking & Database Problems

Who is online

Users browsing this forum: Yahoo [Bot] and 5 guests