- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
你好 friend ,whatsapp 中有一个选项,我们可以通过它更改 whatsapp 聊天的背景墙纸。我正在制作一个项目,其中我提供了很多壁纸,我想从我的壁纸列表中设置壁纸
我使用了这段代码,但代码不起作用
Intent shareIntent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.setType("image/*");
Uri uri = Uri.parse("android.resource://com.mypackagename/"+R.drawable.image);
shareI
ntent.putExtra(Intent.EXTRA_STREAM, uri);
startActivity(Intent.createChooser(shareIntent, "Share via"));Intent = new
最佳答案
为了允许其他应用程序调用您的应用程序或请求,您必须定义两件事..
<intent-filter>
在 Mainfest.xml 中Intent
在 onCreate
方法..Intent
以 Activity RESULT 举办 Activity 如果你想在其他通话中将你的图像/文本分享到其他应用程序,有两种方式..
为此你必须使用 android.intent.action.SEND
过滤器
为此你必须使用 android.intent.action.PICK
过滤器
list .xml
<application
android:allowBackup="true"
android:icon="@drawable/image1"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<!-- share your image with host application -->
<action android:name="android.intent.action.SEND"/>
<category android:name="android.intent.category.DEFAULT"/>
<!-- answer to host application for image request -->
<action android:name="android.intent.action.PICK"/>
<category android:name="android.intent.category.OPENABLE"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:mimeType="image/*"/>
</intent-filter>
</activity>
</application>
在 MainActivity
中创建
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// get intent from host activity
Intent intent = getIntent();
if(!intent.getAction().equals("android.intent.action.MAIN")){
// check about request
if (intent.getAction().equals("android.intent.action.PICK")) {
// return to activity with result OK and image selected image
Intent result = new Intent("com.example.RESULT_ACTION", Uri.parse("content://result_uri"));
setResult(Activity.RESULT_OK, result);
finish();
}
}
}
关于android - 如何以编程方式通过我的应用程序更改 whatsapp 壁纸?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23027904/
我发现这个插件可以让youtube视频作为背景:http://formstone.it/components/wallpaper 看起来很简单,但行不通。我也没有收到任何错误。我在 codepen 上
我为 android 制作壁纸,我希望用户可以选择选项。显示带有选项的菜单,但有问题。当我单击任何选项并返回壁纸屏幕时,它们不会更新新选项。为什么?我的代码WallpaperService: publ
你好 friend ,whatsapp 中有一个选项,我们可以通过它更改 whatsapp 聊天的背景墙纸。我正在制作一个项目,其中我提供了很多壁纸,我想从我的壁纸列表中设置壁纸 我使用了这段代码,但
我在几个地方读到桌面墙纸可以设置为 HTML 文档。有没有人成功地以编程方式改变它? 下面的 VB6 代码片段帮助我为 BMP 设置东西,但是当我尝试将它用于 HTML 时,我得到一个漂亮的蓝色背景,
我正在尝试使用 clx 更改墙纸,但它不起作用。我的代码有什么问题? (ql:quickload :clx) (defpackage #:wm/uw (:use #:cl #:xlib)) (in
我正在尝试指定一个 jpg 文件作为特定桌面的壁纸,但它似乎不起作用...而是将背景更改为另一个图像不同的文件夹...有人知道如何修复它吗? tell application "System Even
我正在尝试指定一个 jpg 文件作为特定桌面的壁纸,但它似乎不起作用...而是将背景更改为另一个图像不同的文件夹...有人知道如何修复它吗? tell application "System Even
我正在尝试使用代码更改 Android 壁纸。我正在使用 WallpaperManager 类,但没有成功。我在/drawable 目录中使用了一个 .png 图像。我收到一条错误消息,指出“原始类型
我想知道 Android Live 3D 壁纸是如何创建的?使用什么软件?以及开发人员如何使它与触摸、滑动等交互...我希望有人能帮助我如何开始...谢谢 最佳答案 3d 壁纸是在 opengles
我想知道是否可以使用我的笔记本电脑从 ADB 更改 android 壁纸。我不知道是否存在任何命令,或者我是否需要将图片复制到文件夹或编辑文本文件。如果可能的话,我需要通过 ADB 解决这个问题。 谢
我在过去的几周里(认真地)在网上搜索过,但我找不到我需要的东西。我只想启动一个与 set as 操作相对应的 Intent 。它通常提供设置为墙纸 或设置为联系人图片。然后,如果设备上安装了更多应用程
我想更改 Windows 中的桌面墙纸(7,如果有影响的话)。 我下面的尝试没有成功。据我所知,它不会更改墙纸、注册表项或执行除打印“0”以外的任何操作。 require 'Win32API' SPI
目标是在没有控件的情况下在 UIView 中播放视频文件 (*.mp4)。 它将作为 ViewController 和其他控件的背景/墙纸,即 tableview、文本字段、图像将在视频播放时显示在
有没有办法在 C++ 中获取 Windows 墙纸(图标后面)的句柄以便在上面绘制?这将允许制作事件桌面(在 Windows XP 之后停产)等价物、Wallpaper Engine 等价物或任何其他
我希望使用 Windows API 在 C++ 中更改 Windows 桌面背景墙纸。 我已阅读以下有关此主题的帖子: How to change desktop background using V
我知道这个问题之前已经被问过,但是有谁知道是否可以以编程方式为最新的 iphone 操作系统iOS4.2(测试版)设置主屏幕(壁纸)的背景图像 。我知道这在以前是不可能的。 我发现您可以通过写入/va
我是一名优秀的程序员,十分优秀!