【问题标题】:Set wallpaper without wallpaper manager, call default set as methods设置没有壁纸管理器的壁纸,调用默认设置为方法
【发布时间】:2018-10-09 09:40:12
【问题描述】:

我正在尝试将默认壁纸集调用为方法,但它不起作用 我已经在堆栈上尝试了这么多代码,但它不起作用,所以请任何人有解决方案请回复

Uri uri = Uri.parse(url.toString());
            Intent intent = new Intent(Intent.ACTION_ATTACH_DATA);
            intent.setDataAndType(uri, "image/jpg");
            intent.putExtra("mimeType", "image/jpg");
            startActivityForResult(Intent.createChooser(intent, "Set As"), 200);

【问题讨论】:

  • 在哪个安卓版本?
  • 我正在尝试安卓奥利奥

标签: android android-intent wallpaper android-wallpaper wallpapermanager


【解决方案1】:
Can u try the below code:

Intent intent = new Intent(Intent.ACTION_ATTACH_DATA);
intent.addCategory(Intent.CATEGORY_DEFAULT);
intent.setDataAndType(uri, "image/jpeg");
intent.putExtra("mimeType", "image/jpeg");
this.startActivity(Intent.createChooser(intent, "Set as:"));

【讨论】:

  • 确定您正在测试的设备
  • honor 7 with android oreo 8.0.0 and also try with Moto G5s Plus with android Oreo
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-04-14
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多