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

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 - System, Settings, Change, WRITE_SETTTINGS

System, Settings, Change, WRITE_SETTTINGS

Quickly share your Android Code Snippets here...

System, Settings, Change, WRITE_SETTTINGS

Postby plusminus » Tue Nov 11, 2008 6:24 am

AndroidManifest.xml:
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <uses-permission android:name="android.permission.WRITE_SETTINGS" />
Parsed in 0.000 seconds, using GeSHi 1.0.8.4

Any Activity:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. android.provider.Settings.System.putInt(this.getContentResolver(), android.provider.Settings.System.SOUND_EFFECTS_ENABLED, 1);
Parsed in 0.011 seconds, using GeSHi 1.0.8.4


SDK Version compatible: 1.0 (maybe prior versions too)
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Top

Postby sandis84 » Fri Aug 28, 2009 10:28 am

I dont get this to work in 1.5. How to do? =)
sandis84
Experienced Developer
Experienced Developer
 
Posts: 78
Joined: Fri Aug 07, 2009 3:54 pm

Postby WarrenFaith » Fri Aug 28, 2009 5:26 pm

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. Settings.System.putInt(this.getContentResolver(), "mySetting", 1);
  2.  
  3. int setting = 0;
  4.  
  5. try {
  6.  
  7.     setting = Settings.System.getInt(this.getContentResolver(), "mySetting");
  8.  
  9. } catch (SettingNotFoundException e) {
  10.  
  11.     Log.e(LOG_TAG, "Setting mySetting not found");
  12.  
  13. }
  14.  
  15. Log.i(LOG_TAG, "Setting mySetting: " + setting);
Parsed in 0.010 seconds, using GeSHi 1.0.8.4


works fine for me...
WarrenFaith
Moderator
Moderator
 
Posts: 227
Joined: Fri Mar 13, 2009 10:59 am
Location: Berlin, Germany

Top

Return to Code Snippets for Android

Who is online

Users browsing this forum: No registered users and 2 guests