I am calling 'setBackgroundResource' on some png files, which are in the res/drawable-mdpi folder, but not in the other folders.
But after a few back and forward loads the phone runs out of memory.
Any way to clear the memory so I can load the new graphics.
[HIGH]String map_up_theme_res = CoreFunctions.mapThemeRes("up");
String map_down_theme_res = CoreFunctions.mapThemeRes("down");
String service_up_theme_res = CoreFunctions.serviceThemeRes("up");
String service_down_theme_res = CoreFunctions.serviceThemeRes("down");
try {
townUpMap.setBackgroundResource(CoreFunctions.getResId(
map_up_theme_res, R.drawable.class));
townDownMap.setBackgroundResource(CoreFunctions.getResId(
map_down_theme_res, R.drawable.class));
serviceUpTray.setBackgroundResource(CoreFunctions.getResId(
service_up_theme_res, R.drawable.class));
serviceDownTray.setBackgroundResource(CoreFunctions.getResId(
service_down_theme_res, R.drawable.class));
} catch (OutOfMemoryError E) {
}[/HIGH]
But after a few back and forward loads the phone runs out of memory.
Any way to clear the memory so I can load the new graphics.
[HIGH]String map_up_theme_res = CoreFunctions.mapThemeRes("up");
String map_down_theme_res = CoreFunctions.mapThemeRes("down");
String service_up_theme_res = CoreFunctions.serviceThemeRes("up");
String service_down_theme_res = CoreFunctions.serviceThemeRes("down");
try {
townUpMap.setBackgroundResource(CoreFunctions.getResId(
map_up_theme_res, R.drawable.class));
townDownMap.setBackgroundResource(CoreFunctions.getResId(
map_down_theme_res, R.drawable.class));
serviceUpTray.setBackgroundResource(CoreFunctions.getResId(
service_up_theme_res, R.drawable.class));
serviceDownTray.setBackgroundResource(CoreFunctions.getResId(
service_down_theme_res, R.drawable.class));
} catch (OutOfMemoryError E) {
}[/HIGH]