1. Introducing Channels - a new way to chat with other Android users!
    Dismiss Notice

Programmatically remove widget


Last Updated:

  1. yenpei

    yenpei Member This Topic's Starter

    Joined:
    Jun 24, 2010
    Messages:
    7
    Likes Received:
    0
    Hi,

    I have a widget but when I have un-installed my app, the widget still exist in the home screen with "Problem loading widget".

    How do I programmatically remove the widget? It seems that many widget on Android Market also have similar problem, but really hope to get this eye sore fixed.

    YEN PEI.
     

    Advertisement
  2. mike114

    mike114 Well-Known Member

    Joined:
    Sep 7, 2010
    Messages:
    200
    Likes Received:
    27
    You should just be able to grab and drag it to the trash bin.
     
    yenpei likes this.
  3. amlothi

    amlothi Well-Known Member

    Joined:
    Jul 23, 2010
    Messages:
    1,185
    Likes Received:
    201
    Your launcher still thinks the widget is there on the home screen, but the widget application doesn't exist.

    Just long press on the broken widget and drag it to the trash. It's the same way you'd remove any widget from your screen (without uninstalling).
     
    Dino80 and yenpei like this.
  4. yenpei

    yenpei Member This Topic's Starter

    Joined:
    Jun 24, 2010
    Messages:
    7
    Likes Received:
    0
    Thanks. I know the manual step but this is not an elegant way to clean up the widget. The widget should uninstall itself upon app uninstallation.
     
  5. BookLover

    BookLover Well-Known Member

    Joined:
    Oct 11, 2010
    Messages:
    977
    Likes Received:
    114
    Some folks don't use widgets, but rather shortcuts to the apps themselves for theming and to save battery and not all apps have widgets. Add to that that people use different launchers and you are asking devs to write a lot of extra code for little benefit as well as potentially introducing errors into their programs to account for all that variability. Unrealistic.
     
  6. yenpei

    yenpei Member This Topic's Starter

    Joined:
    Jun 24, 2010
    Messages:
    7
    Likes Received:
    0
    I'd think if this issue cannot be solved, it's an embarrassment to Android as this is such a visible bug, at least from developer's perspective.
     
  7. BookLover

    BookLover Well-Known Member

    Joined:
    Oct 11, 2010
    Messages:
    977
    Likes Received:
    114
    I completely disagree. Not an embarassment, but simple ROI. Would you pay for the feature? If yes, then contact the programmers and tell them you'd be willing to pay them to do this little thing for you.

    You have to be practical. Unless you've done programming yourself, you probably won't understand.
     
  8. lennyjew

    lennyjew Well-Known Member

    Joined:
    Mar 22, 2010
    Messages:
    369
    Likes Received:
    38
    You can't expect a dev to add in lines and lines of new code for every new home screen app that comes out to fix this when the solution is to drag and drop an inch or so.

    I'll take a smaller file size in exchange for something that literally takes a second to remedy on my own.
     
  9. yenpei

    yenpei Member This Topic's Starter

    Joined:
    Jun 24, 2010
    Messages:
    7
    Likes Received:
    0
    The idea is simple: "Uninstalling the app should also uninstall its associated widget".
    I think this is common sense rather than any technical complication involved.
     
  10. lennyjew

    lennyjew Well-Known Member

    Joined:
    Mar 22, 2010
    Messages:
    369
    Likes Received:
    38
    You still aren't getting it. Different people code differently. A widget might uninstall fine on one home app while it'll leave something like what you've seen on another. Now that may be an issue on the widget app side, or it might be an issue with the way the home app works.

    The point is, you can't expect every widget and every home app dev to write it code to make it compatible with every other android app dev's coding. Especially when the fix takes so little time to deal with and is simple as hell to figure out.
     
    BookLover likes this.
  11. takeshi

    takeshi Well-Known Member

    Joined:
    Dec 6, 2009
    Messages:
    3,354
    Likes Received:
    281
    Everything seems simple when you aren't aware of the details involved... :rolleyes:

    The idea may be simple but ideas don't implement themselves. Ideas don't debug themselves or QA themselves.

    It's not any more embarrassing than Windows apps not deleting shortcuts that I create. Granted, a widget isn't a shortcut but the solution to the "embarrassment" is the same: drag it to the trash and be done with it.

    As stated above, if it really bothers you then contact the developers of your apps rather than post here.
     
  12. jasonkow

    jasonkow New Member

    Joined:
    Feb 27, 2011
    Messages:
    1
    Likes Received:
    0
    i'm a .net & android developer myself. i agree with your developer's point of view, but i also think yenpei has raised a valid request. valid, but maybe be worth to solve. however simply denying users requests by saying not practical or unrealistic makes developers look bad. who drives the requirements after all? yes if possible i'd like windows to prompt me to remove my shortcuts after uninstalling an application. if it's too difficult then it could be a framework problem, not mine as a user. if developers decide everything then monitors would still be 16-color i guess.
     
  13. BookLover

    BookLover Well-Known Member

    Joined:
    Oct 11, 2010
    Messages:
    977
    Likes Received:
    114
    If I were to ask a developer to spend their time doing something for me, I would guarantee I would ask them to do something I have no clue how to do myself. Dragging an inactive widget to the trash, I can do easily. Sure people can ask, but I really don't see an ROI.
     
    alostpacket likes this.
  14. alostpacket

    alostpacket Over Macho Grande? VIP Member

    Joined:
    Nov 29, 2009
    Messages:
    7,978
    Likes Received:
    3,603
    Apps don't get notified when they are being uninstalled so from a technical/practical standpoint "cleaning up" isn't even possible.

    This is something at the OS level, and I'm sure it will get done at some point. But as features go, I would guess this isn't high on the Android team's priority list. :)
     
  15. sohguanh

    sohguanh Well-Known Member

    Joined:
    Apr 18, 2010
    Messages:
    428
    Likes Received:
    34
    I believe if there are enough developers asking for it, Google will consider add new API to their SDK in their next release.

    Just tell Google end users want it and we developers want to implement provided they expose API for us :p
     
  16. wubbie075

    wubbie075 Well-Known Member

    Joined:
    May 31, 2010
    Messages:
    359
    Likes Received:
    40
    I agree with this, but..........

    I also agree with this. It's really not that big a deal.
     

Share This Page

Loading...