1. Download our Official Android App: Forums for Android!

Programmatically remove widget

Discussion in 'Android Apps & Games' started by yenpei, Nov 30, 2010.

  1. yenpei

    yenpei Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    7
    Joined:
    Jun 24, 2010

    Jun 24, 2010
    7
    0
    5
    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
    Rank:
    None
    Points:
    43
    Posts:
    200
    Joined:
    Sep 7, 2010

    Sep 7, 2010
    200
    27
    43
    Ft Worth, TX
    You should just be able to grab and drag it to the trash bin.
     
    yenpei likes this.
  3. amlothi

    amlothi Android Expert
    Rank:
    None
    Points:
    143
    Posts:
    1,185
    Joined:
    Jul 23, 2010

    Jul 23, 2010
    1,185
    201
    143
    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 Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    7
    Joined:
    Jun 24, 2010

    Jun 24, 2010
    7
    0
    5
    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 Android Expert
    Rank:
    None
    Points:
    113
    Posts:
    977
    Joined:
    Oct 11, 2010

    Oct 11, 2010
    977
    114
    113
    USA
    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 Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    7
    Joined:
    Jun 24, 2010

    Jun 24, 2010
    7
    0
    5
    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 Android Expert
    Rank:
    None
    Points:
    113
    Posts:
    977
    Joined:
    Oct 11, 2010

    Oct 11, 2010
    977
    114
    113
    USA
    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 Android Enthusiast
    Rank:
    None
    Points:
    43
    Posts:
    369
    Joined:
    Mar 22, 2010

    Mar 22, 2010
    369
    38
    43
    Calibration Technician
    Dublin, Ohio
    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 Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    7
    Joined:
    Jun 24, 2010

    Jun 24, 2010
    7
    0
    5
    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 Android Enthusiast
    Rank:
    None
    Points:
    43
    Posts:
    369
    Joined:
    Mar 22, 2010

    Mar 22, 2010
    369
    38
    43
    Calibration Technician
    Dublin, Ohio
    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 Android Expert
    Rank:
    None
    Points:
    163
    Posts:
    3,354
    Joined:
    Dec 6, 2009

    Dec 6, 2009
    3,354
    283
    163
    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 Lurker
    Rank:
    None
    Points:
    5
    Posts:
    1
    Joined:
    Feb 27, 2011

    Feb 27, 2011
    1
    0
    5
    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 Android Expert
    Rank:
    None
    Points:
    113
    Posts:
    977
    Joined:
    Oct 11, 2010

    Oct 11, 2010
    977
    114
    113
    USA
    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?
    Rank:
    None
    Points:
    513
    Posts:
    7,973
    Joined:
    Nov 29, 2009

    Nov 29, 2009
    7,973
    3,603
    513
    Android App Developer
    NY
    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 Android Enthusiast
    Rank:
    None
    Points:
    43
    Posts:
    427
    Joined:
    Apr 18, 2010

    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 Android Enthusiast
    Rank:
    None
    Points:
    43
    Posts:
    359
    Joined:
    May 31, 2010

    May 31, 2010
    359
    40
    43
    I agree with this, but..........

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

Share This Page

Loading...