简体   繁体   English

将动态壁纸放在最前面

[英]Bring Live Wallpaper to Front

I had originally asked another question, but I think I found a work-around, which presents a new question hah! 我本来是问另一个问题,但我想我找到了一种解决方法,它提出了一个新问题,哈哈!

I think my question is fairly basic, and I have searched for anything relevant. 我认为我的问题是很基本的,我已经搜索了任何相关内容。

When you are setting a live wallpaper in android, before you set the wallpaper, you have a chance to view the wallpaper without being in the background with all of your icons above it. 当您在android中设置动态壁纸时,在设置壁纸之前,您将有机会查看壁纸而无需在背景中显示所有图标。 A sort of "preview" of the wallpaper. 墙纸的一种“预览”。

Is there a simple java code to force this activity, on a double tap for instance? 是否有简单的Java代码来强制执行此活动,例如双击? I want the user to be able to bring the wallpaper to the front on demand basically. 我希望用户能够基本上将墙纸按需放在最前面。

Maybe this isn't possible, but I assume it is as you can do it before you actually set the wallpaper. 也许这是不可能的,但是我认为这是您在实际设置墙纸之前可以做的。

Any help would be greatly appreciated. 任何帮助将不胜感激。

Thanks, 谢谢,

Jack 插口

Edit- 编辑-

I should note I think I found a similar question but the English is so bad I can't tell: 我应该注意,我想我也找到了类似的问题,但是英语太糟糕了,我不能说:

How to make directly show live wallpaper in main activity? 如何在主要活动中直接显示动态壁纸?

    public void StartActivity() {

    WallpaperInfo localWallpaperInfo = ((WallpaperManager) getSystemService("wallpaper")).getWallpaperInfo();
    if (localWallpaperInfo != null) {
        String str1 = localWallpaperInfo.getSettingsActivity();

        if (str1 != null) {
            String str2 = localWallpaperInfo.getPackageName();
            Intent localIntent1 = new Intent();
            ComponentName localComponentName = new ComponentName(str2, str1);
            localIntent1.setComponent(localComponentName);
            localIntent1.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            startActivity(localIntent1);
        }
    }

You can use wallpaper.bringToFront(); 您可以使用wallpaper.bringToFront(); With a double tap listener. 带有双击监听器。

Or you can use the answer on the question you have in your edit. 或者,您可以对编辑中存在的问题使用答案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM