Re: [android-developers] Re: putInt force closes

2012-03-26 Thread Dianne Hackborn
And if you were to look at the log, you would see an error message
explicitly saying the problem is that you don't have that permission.

On Tue, Mar 27, 2012 at 1:44 AM, dmanpearl  wrote:

> JP,
> You must use the permission request "WRITE_SETTINGS", not "WRITE_SETTING".
> 
>  - David
>
>
> On Sunday, July 25, 2010 11:11:14 PM UTC-7, scadaguru wrote:
>>
>> I am trying to write the system setting using:
>>
>> Settings.System.putInt(**getApplicationContext().**getContentResolver(),
>> Settings.System.WIFI_SLEEP_**POLICY,
>> Settings.System.WIFI_SLEEP_**POLICY_NEVER_WHILE_PLUGGED);
>>
>> But it force closes my application. Any Idea? My has user following
>> permissions:
>>
>>   
>>   > android:name="android.**permission.RECEIVE_BOOT_**COMPLETED"/>
>>   >
>> >
>>   > android:name="android.**permission.UPDATE_DEVICE_**STATS"/>
>>   >
>> >
>>   
>>
>> Thanks,
>> JP
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

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

[android-developers] Re: putInt force closes

2012-03-26 Thread dmanpearl
JP,
You must use the permission request "WRITE_SETTINGS", not "WRITE_SETTING".

 - David

On Sunday, July 25, 2010 11:11:14 PM UTC-7, scadaguru wrote:
>
> I am trying to write the system setting using: 
>
> Settings.System.putInt(getApplicationContext().getContentResolver(), 
> Settings.System.WIFI_SLEEP_POLICY, 
> Settings.System.WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED); 
>
> But it force closes my application. Any Idea? My has user following 
> permissions: 
>
>
>android:name="android.permission.RECEIVE_BOOT_COMPLETED"/> 
>> 
>android:name="android.permission.UPDATE_DEVICE_STATS"/> 
>> 
>
>
> Thanks, 
> JP

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

[android-developers] Re: putInt force closes

2010-07-26 Thread scadaguru
John,
Thanks for the reply.
I am trying this app on Nexus One so it has WiFi.
Your question about value being null is that you are referring that
getApplicationContext() or getContentResolver() returns null?
I will check out the values before passing to putInt. This fails on
AVD also but I can take that AVD does not have WiFi but still it has
system setting which has that WIFI_SLEEP_POLICY to read and write.
Thanks again for your reply and any further help appreciated.
JP.

On Jul 26, 1:20 am, "Maps.Huge.Info (Maps API Guru)"
 wrote:
> Is the value is null? What device does this user have? Does it even
> have a wifi?
>
> There could be lots of reasons, you should make your app bullet proof,
> or at least resistant by testing the value to make sure you have what
> you think before using putInt.
>
> -John Coryat

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


[android-developers] Re: putInt force closes

2010-07-25 Thread Maps.Huge.Info (Maps API Guru)
Is the value is null? What device does this user have? Does it even
have a wifi?

There could be lots of reasons, you should make your app bullet proof,
or at least resistant by testing the value to make sure you have what
you think before using putInt.

-John Coryat

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