You need to request that permission in the AndroidManifest.xml file of
your project.

On Sun, Nov 2, 2008 at 2:43 PM, joshbeck <[EMAIL PROTECTED]> wrote:
>
> The process number of my application was 3447.
> It says:
> CAUSED by: java.lang.SecurityException: Access denied to process: 3447
> must have permission android.permission.SET_WALLPAPER
>
> This is the emulator.
>
> Any idea how to grant permission?
>
> Thanks,
>
>
> On Nov 2, 4:05 pm, Romain Guy <[EMAIL PROTECTED]> wrote:
>> What is the exception you see in logcat?
>>
>>
>>
>> On Sun, Nov 2, 2008 at 2:01 PM, joshbeck <[EMAIL PROTECTED]> wrote:
>>
>> > Ok, I have a short program written that I'd like to see change the
>> > system wallpaper.
>> > I use setWallpaper(Bitmap bitmap);
>> > It is crashing my system.
>> > I think it is because it is broadcasting an intent and I'm
>> > not set up to receive it correctly.
>> > Any help is appreciated. Thank you!
>>
>> > --Here is the code: Look at the try block for my comment--
>>
>> > import --ALL IMPORTS CORRECT--
>>
>> > public class wallpaper1 extends Activity {
>> >    /** Called when the activity is first created. */
>> >   SampleView mview;
>> >        @Override
>> >    public void onCreate(Bundle savedInstanceState) {
>> >        super.onCreate(savedInstanceState);
>> >        mview = new SampleView(this);
>>
>> >        setContentView(mview);
>>
>> >    }
>>
>> >    private static class SampleView extends View {
>>
>> >        private  Canvas mCanvas;
>> >        private final Paint mPaint;
>> >        private Bitmap mBitmap;
>> >        private Drawable mdrawable;
>> >        private string wallstring;
>> >        public SampleView(Context context)  {
>>
>> >                super(context);
>>
>> >                mPaint = new Paint();
>> >            mPaint.setAntiAlias(true);
>> >            mPaint.setARGB(255, 255, 255, 255);
>>
>> >            try {
>>
>> >                //This line right here crashes the program
>> >                // The graphic darkcleanlinux is valid. (640x480)
>> >                // The API for setWallpaper states that an intent
>> >                // ACTION_WALLPAPER_CHANGED is broadcast.
>> >               //Do I need to set up a listener? How?
>> >                  
>> > context.setWallpaper(BitmapFactory.decodeResource(getResources(),
>> >                      R.drawable.darkcleanlinux));
>>
>> >                                mdrawable = context.getWallpaper();
>>
>> >                        } catch (IOException e) {
>> >                                 //TODO Auto-generated catch block
>> >                                e.printStackTrace();
>> >                        }
>>
>> >                }
>>
>> > }
>> > }
>>
>> --
>> Romain Guywww.curious-creature.org
> >
>



-- 
Romain Guy
www.curious-creature.org

--~--~---------~--~----~------------~-------~--~----~
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