Clear Android Desktop

Source: Internet
Author: User

How can I clean up Android desktops?

Override the clearwallpaper method defined in contextwrapper IN THE ACTIVITY

@ Override
Public void clearwallpaper () throws ioexception
{
// Todo auto-generated method stub
Super. clearwallpaper ();
}

You can do it. Of course, if we clean up the desktop, the user is setting the desktop. In the event of a conflict, the ioexception will be thrown.

Bytes ---------------------------------------------------------------------------------------------

How can I change background images for Android desktops?

@ Override
Public void setwallpaper (Bitmap bitmap) throws ioexception {
Super. setwallpaper (Bitmap );
}

(Bitmapfactory has a large number of methods for me to obtain bitmap objects through images. In addition, bitmap also has many static methods to create a bitmap object for Desktop Replacement .)

@ Override
Public void setwallpaper (inputstream data) throws ioexception {
Super. setwallpaper (data );
}

The resources object can be called. The openrawresources method is used to obtain an inputstream through images.

----------------------------------------------------------------------

How can I obtain the current Android desktop image?

@ Override
Public drawable getwallpaper (){
Return super. getwallpaper ();
}

And

Public drawable peekwallpaper (){
Return super. peekwallpaper ();
} Yes. The difference between the two is that when there is no desktop, getwallpaper returns the Default background of the system, while peekwallpaper returns NULL.

--------------------------------------------------------------------------------

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.