android怎么设置背景?android背景设置教程
1、public static final String TAG = "WallpaperActivity";/*** 背景图片名称*/private static final String FILE_NAME = "MM-320x480.png";/*** @see android.app.Activity#onCreate(android.os.Bundle)*/public void onCreate(Bundle cycle) {super.onCreate(cycle);super.setContentView(R.layout.wallpaper);

3、// 设置桌面背景this.putWallpaper(wallpaper);}

5、/*** 设置桌面背景* www.cnxuwen.com*/private void putWallpaper(Bitmap bitmap) {try {WallpaperManager wallpaperManager = WallpaperManager.getInstance(this);wallpaperManager.setBitmap(bitmap);} catch (IOException e) {String msg = "设置桌面背景发生异常:" + e.getLocalizedMessage();Log.e(TAG, "设置桌面背景发生异常!", e);Toast.makeText(this, msg, Toast.LENGTH_LONG).show();}}

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。