Z
Z
Zenx2015-01-18 12:46:00
Android
Zenx, 2015-01-18 12:46:00

Do I need to return data from Service to Activity via Intent?

There is a Service that rakes out simple data, such as String, at a given interval. Do I need to return this data to the main activity with an Intent, or can I simply get variables through the Service object?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
one pavel, 2015-01-18
@onepavel

In the documentation, the developers described options for interacting with the service
developer.android.com/guide/components/bound-servi...
Use Messenger, simple and convenient.

M
Max, 2015-01-19
@mbelskiy

And if you store data in DB via ContentProvider, then in the service it will be enough to write data to the database, and fasten the CursorLoader in the activity / fragment

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question