开发者

Not able to use the constant defined in Service class which is in different package

开发者 https://www.devze.com 2023-02-19 08:08 出处:网络
I am implementing \"Bound Services\" using 开发者_开发知识库messenger. As given in \"http://developer.android.com/guide/topics/fundamentals/bound-services.html\", if I try accessing service.class[serv

I am implementing "Bound Services" using 开发者_开发知识库messenger. As given in "http://developer.android.com/guide/topics/fundamentals/bound-services.html", if I try accessing service.class[service is the name of the class] or service.constant in Message.obtain or bindService in my activity class, it is not recognizing service class name as a class.

Service class is in different package and the activity class is in different package.

Can anyone please help in fixing this error. Do I have to add jar file of service in build path of activity??

Thanks.


Is your service class declared as public?

Otherwise, can you give more context? How exactly do you call the service class or service constant?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号