Android4.0 Music player Appwidget new repeat play button picture how to sync updates in the main app

Source: Internet
Author: User

============ Problem Description ============


Add a duplicate play ImageButton on Appwidget, which has no repetition, repeats the current song, repeats all songs, respectively for different pictures (source code only artist, album, play Pause, Next button).
After Appwidget click on the Play button, the main app activity will change accordingly, but on the main app, click on it's repeat imagebutton,appwidget on the repeat play on the current song does not change over, and repeat all the songs to play to the next song to be updated. cannot be updated immediately. Respectively in the Appwidget, activity can be updated, the problem is: activity in the click button, the corresponding button on the widget is not immediately refreshed. Ask the hero to advise

============ Solution 1============


The so-called "update Appwidget", that is appwidgetprovider know the change when notified Appwidgethost update:

Update the remoteviews when the status changes, and then update it with Remoteviews by Appwidgetmanager.updateappwidget ()
The Appwidget system will notify Appwidgethost to update its appwidgethostview.

Android4.0 Music player Appwidget new repeat play button picture how to sync updates in the main app

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.