I need to be able to change the value of an Integer in a service while it is running, using an activity.
How should I implement this?
Any help or advice is appreciated.
I need to be able to change the value of an Integer in a
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
One thing you can do is potentially add a broadcast receiver in your service that you communicate with through your activity.
Here is the communication:
From the activity send a broadcast
Have your BroadcastReceiver (potentially in your service) listen to
this broadcast from your activity and when it receives it, just
update a member variable found in your service.