Skip to content

Commit

Permalink
Fix #147
Browse files Browse the repository at this point in the history
  • Loading branch information
pocorall committed Jul 5, 2016
1 parent 3062374 commit 3624348
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -478,8 478,13 @@ class LocalServiceConnection[S <: LocalService](bindFlag: Int = Context.BIND_AUT
*/
def connected: Boolean = service.isDefined

/**
* Creating an intent for ctx.bindService(). Extend this when you need to to something other.
*/
def createIntent(): Intent = SIntent[S]

reg.onRegister {
ctx.bindService(SIntent[S], this, bindFlag)
ctx.bindService(createIntent(), this, bindFlag)
}

reg.onUnregister {
Expand Down
7 changes: 6 additions & 1 deletion scaloid-common/src/main/st/org/scaloid/common/content.scala
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 241,13 @@ class LocalServiceConnection[S <: LocalService](bindFlag: Int = Context.BIND_AUT
*/
def connected: Boolean = service.isDefined

/**
* Creating an intent for ctx.bindService(). Extend this when you need to to something other.
*/
def createIntent(): Intent = SIntent[S]

reg.onRegister {
ctx.bindService(SIntent[S], this, bindFlag)
ctx.bindService(createIntent(), this, bindFlag)
}

reg.onUnregister {
Expand Down

0 comments on commit 3624348

Please sign in to comment.