toast out of memory
This commit is contained in:
parent
aa46479cdb
commit
48d30f2da3
1 changed files with 10 additions and 5 deletions
|
@ -38,6 +38,7 @@ import info.nightscout.androidaps.plugins.NSClientInternal.events.EventNSClientS
|
||||||
import info.nightscout.androidaps.plugins.NSClientInternal.events.EventNSClientUpdateGUI;
|
import info.nightscout.androidaps.plugins.NSClientInternal.events.EventNSClientUpdateGUI;
|
||||||
import info.nightscout.androidaps.plugins.NSClientInternal.services.NSClientService;
|
import info.nightscout.androidaps.plugins.NSClientInternal.services.NSClientService;
|
||||||
import info.nightscout.utils.SP;
|
import info.nightscout.utils.SP;
|
||||||
|
import info.nightscout.utils.ToastUtils;
|
||||||
|
|
||||||
public class NSClientInternalPlugin implements PluginBase {
|
public class NSClientInternalPlugin implements PluginBase {
|
||||||
private static Logger log = LoggerFactory.getLogger(NSClientInternalPlugin.class);
|
private static Logger log = LoggerFactory.getLogger(NSClientInternalPlugin.class);
|
||||||
|
@ -189,12 +190,16 @@ public class NSClientInternalPlugin implements PluginBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateLog() {
|
private void updateLog() {
|
||||||
Spanned newTextLog = Html.fromHtml("");
|
try {
|
||||||
for (EventNSClientNewLog log : listLog) {
|
Spanned newTextLog = Html.fromHtml("");
|
||||||
newTextLog = (Spanned) TextUtils.concat(newTextLog, log.toHtml());
|
for (EventNSClientNewLog log : listLog) {
|
||||||
|
newTextLog = (Spanned) TextUtils.concat(newTextLog, log.toHtml());
|
||||||
|
}
|
||||||
|
textLog = newTextLog;
|
||||||
|
MainApp.bus().post(new EventNSClientUpdateGUI());
|
||||||
|
} catch (OutOfMemoryError e) {
|
||||||
|
ToastUtils.showToastInUiThread(MainApp.instance().getApplicationContext(), "Out of memory!\nStop using this phone !!!");
|
||||||
}
|
}
|
||||||
textLog = newTextLog;
|
|
||||||
MainApp.bus().post(new EventNSClientUpdateGUI());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void resend(String reason) {
|
public void resend(String reason) {
|
||||||
|
|
Loading…
Reference in a new issue