It Is Not Under Singleton Mode, U Can't Use It
In my Reminder app, If I select time which just passed away, then app not working, getting following error: Log D/ANRAppManager: !!! It is not under singleton mode, U can't use it.
Solution 1:
I think that reacting to signal 3 is a symptom of an ANR. Does the application hang before crashing ? If so, it may be because the loops never ends.
Are you sure that RepeatTime
is always > 0 (and specially not = 0) ?
Something like :
while(diffTime < 0) {
Log.d("SOME_TAG", "set diffTime to " + diffTime);
diffTime += RepeatTime; // at this line getting error
}
should not display more than a few lines.
Update :
You should ensure that either the alarm is in the future or the repeat time is greater than 0.
if (diffTime > 0 || RepeatTime > 0) {
// set the alarm only if the parameters are consistentswhile(diffTime < 0) {
diffTime += RepeatTime; // at this line getting error
}
// Start alarm using initial notification time and repeat interval time
mAlarmManager.setRepeating(AlarmManager.ELAPSED_REALTIME,
SystemClock.elapsedRealtime() + diffTime,
RepeatTime , mPendingIntent);
// Restart alarm if device is rebootedComponentNamereceiver=newComponentName(context, BootReceiver.class);
PackageManagerpm= context.getPackageManager();
pm.setComponentEnabledSetting(receiver,
PackageManager.COMPONENT_ENABLED_STATE_ENABLED,
PackageManager.DONT_KILL_APP);
}
Post a Comment for "It Is Not Under Singleton Mode, U Can't Use It"