Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7700891
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:51:08+00:00 2026-05-31T22:51:08+00:00

Possible Duplicate: Android – how to set the wallpaper image I want to change

  • 0

Possible Duplicate:
Android – how to set the wallpaper image

I want to change the current wallpaper to another one programatically in android.Is it possible?I am doing a project that automatically changes wallpaper depending on the conditions set by the user

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T22:51:10+00:00Added an answer on May 31, 2026 at 10:51 pm

    firstly add this permission in AndroidManifest.xml file

    <uses-permission android:name="android.permission.SET_WALLPAPER">
    

    main.xml:

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
    
        android:orientation="vertical" >
    
        <Button
            android:layout_margin="20dp"
            android:id="@+id/set"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="Set WallPaper" />
    <ImageView
            android:layout_margin="20dp"
            android:id="@+id/preview"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
             />
    
    </LinearLayout>
    

    then below is your java code which you to implement:

         public class SetWallpaper extends Activity {
                Bitmap bitmap;
                int lastImageRef;
    
                /** Called when the activity is first created. */
                @Override
                public void onCreate(Bundle savedInstanceState) {
                    super.onCreate(savedInstanceState);
                    setContentView(R.layout.main);
    
                    Button buttonSetWallpaper = (Button)findViewById(R.id.set);
                    ImageView imagePreview = (ImageView)findViewById(R.id.ic_launcher);
                    imagePreview.setImageResource(R.drawable.five);
    
                    buttonSetWallpaper.setOnClickListener(new Button.OnClickListener(){
                        @Override
                        public void onClick(View arg0) {
                            // TODO Auto-generated method stub
                            WallpaperManager myWallpaperManager
                            = WallpaperManager.getInstance(getApplicationContext());
                            try {
                                    myWallpaperManager.setResource(R.drawable.ic_launcher);
                            } catch (IOException e) {
                                    // TODO Auto-generated catch block
                                    e.printStackTrace();
                            }
                        }});
                 }
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Android - how to set the wallpaper image I hav started doing
Possible Duplicate: Android Launch an application from another application I want to start Another
Possible Duplicate: Android, move bitmap along a path? I want to move an image
Possible Duplicate: Android :Text Animation I want to know how I can implement the
Possible Duplicate: Disable back button in android i don't want to dismiss my dialog
Possible Duplicate: Android: How can I get the current foreground activity (from a service)?
Possible Duplicate: Android: ProgressDialog.show() crashes with getApplicationContext I want to have a progress dialog
Possible Duplicate: Android Webview - Webpage should fit the device screen I want to
Possible Duplicate: Android create shortcuts on the home screen I am having one TextView
Possible Duplicate: Developing for Android in Eclipse: R.java not generating I cleaned my project

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.