java - GCM class cast exception -


if (googleplayservicesutil.isuserrecoverableerror(resultcode)) {         googleplayservicesutil.geterrordialog(resultcode, (activity)        context, play_services_resolution_request).show();     }  

exception:

java.lang.classcastexception: com.interconnect.garhoud.garhoud cannot cast android.app.activity @ com.interconnect.library.gcm.util.checkplayservices(util.java:96) @ com.interconnect.library.gcm.regiseter.handleregister(regiseter.java:53) @ com.interconnect.library.gcm.regiseter.onhandleintent(regiseter.java:30) @ android.app.intentservice$servicehandler.handlemessage
(intentservice.java:65) @ android.os.handler.dispatchmessage(handler.java:102) @ android.os.looper.loop(looper.java:146) @ android.os.handlerthread.run(handlerthread.java:61)

i have used context getapplicationcontext, because have called if intent service. how can handle exception?

as cannot show dialog service, can instead use googleplayservicesutil.showerrornotification(), allows post notification prompting user resolve error google play services.


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -