Note that there are some explanatory texts on larger screens.

plurals
  1. POStatic memory leak with Context
    primarykey
    data
    text
    <p>I've been doing some researching and I'm still not 100% certain if this could cause an based memory leak. I'm using a button view (v.context). I think I'm OK since the context isn't stored as Static, but I'd like some feedback if possible. The main issue I'm seeing is with OSMonitor... the (M) value goes UP and UP and UP. With every open/close of the widget and on screen rotation. </p> <p>32M 43M 61M 77M etc...</p> <p>I'm not sure if (M) is Megabytes or Megebits. If this is based on the stack, I'm assuming Megebits perhpas since most high end devices are limited to 32/48 MB on the stack (or something).</p> <p>Thanks for the feedback/extra eyes! </p> <p>This is the Banner app in the Market, btw...</p> <pre><code>public class Globals { public static final String PREF_NAME = "BannerPreferences"; public static final int MAX_TEXT_SIZE = 20; // refresh ALL widgets loaded on the user's screens // this could be for removing or adding 'pendingIntents or during bootup public static void refreshAllWidgets(Context context) { Logger.d("BANNER", "Globals:refreshAllWidgets"); invalidateWidgets(context, BannerWidget.class); // 1x4 invalidateWidgets(context, BannerWidget1x2.class); invalidateWidgets(context, BannerWidget2x2.class); } // there has to be a API way to do this!! Until then, just loop thru all // widget_provider classes.. private static void invalidateWidgets(Context context, Class&lt;?&gt; cls) { ComponentName comp = new ComponentName(context, cls); AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context); int[] appWidgetIds = appWidgetManager.getAppWidgetIds(comp); for (int i = 0; i &lt; appWidgetIds.length; i++) { BannerWidgetBase.updateAppWidget(context, appWidgetManager, appWidgetIds[i]); } appWidgetIds = null; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload