android.content.Context.setWallpaper()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(151)

本文整理了Java中android.content.Context.setWallpaper()方法的一些代码示例,展示了Context.setWallpaper()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Context.setWallpaper()方法的具体详情如下:
包路径:android.content.Context
类名称:Context
方法名:setWallpaper

Context.setWallpaper介绍

暂无

代码示例

代码示例来源:origin: oasisfeng/condom

@Override @Deprecated public void setWallpaper(InputStream data) throws IOException {
  mBase.setWallpaper(data);
}

代码示例来源:origin: oasisfeng/condom

@Override @Deprecated public void setWallpaper(Bitmap bitmap) throws IOException {
  mBase.setWallpaper(bitmap);
}

代码示例来源:origin: Trumeet/MiPushFramework

@Override @Deprecated public void setWallpaper(InputStream data) throws IOException {
  mBase.setWallpaper(data);
}

代码示例来源:origin: Trumeet/MiPushFramework

@Override @Deprecated public void setWallpaper(Bitmap bitmap) throws IOException {
  mBase.setWallpaper(bitmap);
}

代码示例来源:origin: stackoverflow.com

public void setWallpaper() {
 Context context = this.getBaseContext(); 
 Bitmap mBitmap = BitmapFactory.decodeResource(getResources(), mImageIds[pos]);

 context.setWallpaper(mBitmap);
}

代码示例来源:origin: stackoverflow.com

public void setWallpaper() {

    Context context = this.getBaseContext(); 
    Bitmap mBitmap = BitmapFactory.decodeResource(getResources(),mImageIds[pos]);
    context.setWallpaper(mBitmap);
}

代码示例来源:origin: stackoverflow.com

public void setIt(){

Context c = this.getBaseContext();
Bitmap bp = BitmapFactory.decodeResource(getResources(), "your_array");
c.setWallpaper(bp);
}

代码示例来源:origin: stackoverflow.com

try {
  File file = new File("/sdcard/sampleimage");
  Bitmap bitmap = BitmapFactory.decodeResource(getResources(), Url);
  bitmap.compress(CompressFormat.JPEG, 80, new FileOutputStream(file));
  Context context = this.getBaseContext();
  context.setWallpaper(bitmap);            
 } catch (MalformedURLException e) {
  e.printStackTrace();
} catch (IOException e) {
  e.printStackTrace();
}

代码示例来源:origin: stackoverflow.com

public void SetBackground(int Url) {

  try {
    File file = new File("/sdcard/sampleimage");
    Bitmap bitmap = BitmapFactory.decodeResource(getResources(), Url);
    bitmap.compress(CompressFormat.JPEG, 80, new FileOutputStream(file));
    Context context = this.getBaseContext();
    context.setWallpaper(bitmap);            
    Toast.makeText(getApplicationContext(), "Wallpaper has been set",             Toast.LENGTH_SHORT).show();            
  } catch (MalformedURLException e) {
    e.printStackTrace();
  } catch (IOException e) {
    e.printStackTrace();
  }         
}

代码示例来源:origin: stackoverflow.com

public void SetBackground(int Url) {

  try {
    File file = new File("/sdcard/sampleimage");
    Bitmap bitmap = BitmapFactory.decodeResource(getResources(), Url);
    bitmap.compress(CompressFormat.JPEG, 80, new FileOutputStream(file));
    Context context = this.getBaseContext();
    context.setWallpaper(bitmap);            
    Toast.makeText(getApplicationContext(), "Wallpaper has been set",             Toast.LENGTH_SHORT).show();            
  } catch (MalformedURLException e) {
    e.printStackTrace();
  } catch (IOException e) {
    e.printStackTrace();
  }         
}

代码示例来源:origin: stackoverflow.com

public void SetBackground(int Url) {

  try {
    File file = new File("/sdcard/sampleimage");
    Bitmap bitmap = BitmapFactory.decodeResource(getResources(), Url);
    bitmap.compress(CompressFormat.JPEG, 80, new FileOutputStream(file));
    Context context = this.getBaseContext();
    context.setWallpaper(bitmap);            
    Toast.makeText(getApplicationContext(), "Wallpaper has been set",             Toast.LENGTH_SHORT).show();            
  } catch (MalformedURLException e) {
    e.printStackTrace();
  } catch (IOException e) {
    e.printStackTrace();
  }         
}

相关文章

Context类方法