-1

I need to pass 3 float numbers to a service and at the end the service need to send me back 'true' or 'false' boolean value.

I read about the two but do not know what I need to use, an example will be appreciated.

Digol
  • 390
  • 1
  • 15

1 Answers1

1

For your first Question : Passing para to intent service

Using putExtra to pass values to intent service

, and about send notification back to activity from intent service :

Using ResultReceiver in Android

or try to use Callbacks Interface in service and implement it on activity

// on intent service
private onGetNotification notify=(onGetNotification)contextOfActivity;

public interface onGetNotification {
    public setOnGetNotification(Boolean result);
}

// use when finish
public void endOfService(){
    notify.setOnGetNotification(true);
}

Hope That Help :)

Community
  • 1
  • 1
Ramy Sabry
  • 378
  • 2
  • 9
  • Thanks Ramy, it looks good i will try that, if my service is activating a class, and this class is getting 3 parameters and calculates them, and at the end send back one result. did i still need to use your answer? something different? – Digol May 15 '15 at 15:46
  • @Hadar.S you can use ResultReceiver is better – Ramy Sabry May 17 '15 at 09:10
  • Thank you Ramy, looks like a great solution. will try that. – Digol May 21 '15 at 05:09