English 中文(简体)
我该如何称呼土著壁纸拾拾者 来为我的布局设置壁纸?
原标题:What should I do to call Native Wallpaper picker to set Wallpaper for my layout in android?

这就是我的问题。对于不知道我在问什么的人来说,我想让这个菜单出现在我的应用程序中,“http://db.tt/GQX9GBYF” rel=“norefererr”>http://db.tt/GQX9GBYF 。事实是,我不知道如何做到这一点。我认为我必须创造一种意图,从中获取图像路径,然后将它设置为背景。但是我不知道这样做的确切方法。

拜托,谁能给我举个例子??????????????????

我不得不说,我通过启动本地画廊应用程序 做到了这一点, 但我也想设置活墙纸

最佳回答

Intent.ACTION_SET_WALLPAPER 用于启动用于选择壁纸的 ContaxtMenu 代码 :

Intent intent = new Intent(Intent.ACTION_SET_WALLPAPER);
startActivity(Intent.createChooser(intent, "Select Wallpaper"));
问题回答

Currently I m working on the same thing. The accepted answer is correct but if you want to use wallpaper as your app s background, then you have to use Wallpaper theme & call the Intent.Action_Set_Wallpaper to pick wallpaper.

public void onCreate(Bundle savedInstanceState) {

 Activity.this.setTheme(android.R.style.Theme_Wallpaper);

super.onCreate(savedInstanceState);
setContentView(/*some layout*/);
}

//在单击按钮时单击

Intent intent = new Intent(Intent.ACTION_SET_WALLPAPER);
startActivity(Intent.createChooser(intent, "Select Wallpaper"));




相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签