1.设置桌面背景图片的方法


    Resources res=getResources();   


                BitmapDrawable bmpDraw=(BitmapDrawable)res.getDrawable(R.drawable.icon);    


                Bitmap bmp=bmpDraw.getBitmap();


                try{


                    setWallpaper(bmp);


                }catch(IOException e) {


                    e.printStackTrace();


                }


2.在manifest中增加设置桌面的权限


    <uses-permission android:name="android.permission.SET_WALLPAPER" />

posted on 2012-07-18 15:27  清沁  阅读(602)  评论(0编辑  收藏  举报