android - App is getting crashed when I update app through UpdateManager using hockeyapp -
my android app getting crashed while update app through hockeyapp updatemanager.
here update code:
private void checkforupdates() { // remove store builds! updatemanager.register(this, getresources().getstring(r.string.hockey_app_id), new updatemanagerlistener() { @override public void onnoupdateavailable() { super.onnoupdateavailable(); // no update available -> load login screen // setfragment(r.id.container_login, new loginfragment()); } @override public void onupdateavailable(jsonarray data, string url) { super.onupdateavailable(data, url); } }, true); }
it showing update dialog when clicked update after 100% loading app getting crashed. here crash log:
onfatalerror, processing error engine(4) com.google.android.apps.gsa.shared.speech.a.g: error reading input stream @ com.google.android.apps.gsa.staticplugins.recognizer.i.a.a(sourcefile:342)
any appreciated. thanks.
i solved problem searching different documentations of hockeyapp. here solution of above problem:
check updates method:
private void checkforupdates() { strictmode.vmpolicy.builder builder = new strictmode.vmpolicy.builder(); strictmode.setvmpolicy(builder.build()); updatemanager.register(this, getresources().getstring(r.string.hockey_app_id), new updatemanagerlistener() { @override public void onnoupdateavailable() { super.onnoupdateavailable(); // no update available -> load login screen // setfragment(r.id.container_login, new loginfragment()); } @override public void onupdateavailable(jsonarray data, string url) { super.onupdateavailable(data, url); } }, true); }
also need unregister updatemanager in activity onpause() or ondestroy() method.
private void unregistermanagers() { updatemanager.unregister(); } @override public void onpause() { super.onpause(); unregistermanagers(); } @override public void ondestroy() { super.ondestroy(); unregistermanagers(); }
this complete solution of hockeyapp in app update feature.
Comments
Post a Comment