Added action support for binding intent in a LocalServiceConnection #147

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
@GuillauG
Contributor

GuillauG commented May 31, 2016

Extras won't be seen in onBind method of a Service according to Android Documentation
However, the action string can be seen and might be useful for initializing objects in the Service onBind method.

Added action support for binding intent in a LocalServiceConnection
Extras won't be seen in `onBind` method of a Service according to Android Documentation https://developer.android.com/reference/android/app/Service.html#onBind(android.content.Intent)
However, the action string can be seen and might be useful for initializing objects in the Service `onBind` method.
@pocorall

This comment has been minimized.

Show comment
Hide comment
@pocorall

pocorall Jun 1, 2016

Owner

How about making a factory method like this?

  /**
    * Extend this when you need to do something other.
    */
  def createIntent(): SIntent = SIntent[S]

  reg.onRegister {
    ctx.bindService(createIntent(), this, bindFlag)
  }
Owner

pocorall commented Jun 1, 2016

How about making a factory method like this?

  /**
    * Extend this when you need to do something other.
    */
  def createIntent(): SIntent = SIntent[S]

  reg.onRegister {
    ctx.bindService(createIntent(), this, bindFlag)
  }
@GuillauG

This comment has been minimized.

Show comment
Hide comment
@GuillauG

GuillauG Jun 1, 2016

Contributor

I agree, that's clearly a solution :)
My concern is we might try to pass extras when overriding the method, and we should not.
What do you think ?

Contributor

GuillauG commented Jun 1, 2016

I agree, that's clearly a solution :)
My concern is we might try to pass extras when overriding the method, and we should not.
What do you think ?

@pocorall pocorall closed this in 3624348 Jul 5, 2016

@pocorall

This comment has been minimized.

Show comment
Hide comment
@pocorall

pocorall Jul 5, 2016

Owner

The problem you pointed out would not be a bad pitfall for application programmer; It can be easily avoided if one is experienced Android developer. I would prefer more general and clean solution in this time.

Owner

pocorall commented Jul 5, 2016

The problem you pointed out would not be a bad pitfall for application programmer; It can be easily avoided if one is experienced Android developer. I would prefer more general and clean solution in this time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment