google cloud messaging - Android Background Runnable not working on older devices -


i have following running @ startup inside of intentservice

threadmanager.postbackgroundrunnabledelayed(() -> {             try {                 // calling gettoken , getid must on separate thread. otherwise, blocks ui thread.                 string token = instanceid.gettoken(sender_id, googlecloudmessaging.instance_id_scope);                 string id = instanceid.getid();                 timber.d("id: " + id);                 timber.d("token: " + token);                 lazyrestqueue.get().sendgcmtoken(new gcmpushrequest(id, token), getsendgcmtokencallback());                 setupanalytics(token);             } catch (ioexception e) {                 timber.e(e, "exception during registration");                 crashlytics.logexception(e);                 sethastoken(false);             } catch (runtimeexception e) {                 // thrown if localytics not setup                 timber.e(e, "exception during registration");             }         }); 

when run on below api 18 causes app close (not crash oddly, close)

can give me advice on this? know has service or not timing


Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -