android - Just Published 1st App. It works fine on my Nexus 4 Running 4.2, but friend says it crashes on shake on her Electrify M Motorola running 4.1 -
i have question , appreciate help.
my friend says app crashes onshake. first app simple magic 8 ball app, gives random answer when user shakes it. says after opens app, , shakes app instead of receiving random answer on nexus 4, app shutsdown , takes home screen.
here's code think may causing it. added "finish(); shut down activity after user hits homescreen, clear out randomly generated answer instead of storing days.
@override public void onpause() { super.onpause(); msensormanager.unregisterlistener(mshakedetector); finish();
try crash log, including complete stack trace. easiest way asking friend send crash report when android asks him. otherwise plug phone computer, crash app , copy output of adb logcat
. crash log should pinpoint line in code causes crash.
if sure problem in onpause
method, check how initialize msensormanager
. there way might null
(not initialized) on friend's phone? (as cause nullpointerexception
.)
Comments
Post a Comment