android - finishActivity doesn't recognize in Fragment -


i start speech recognition service mainactivity startactivityforresult , put onactivityresult in main. stop service finishactivity in mainactivity. work o.k.

now pass active of service fragment , onactivityresult in fragment. there replay. when put finishactivity in fragment mark in red , didn't recognize it.

it need activity add before getactivity.finishactivity(the request code) , run. doesn't close service more. problem? bar.

try using this.stopself() if in same service

or inside onactivityresult try calling stopservice(intent)

refer

alternative finish() method service class? kill dead

for same


Comments

Popular posts from this blog

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

html - Outlook 2010 Anchor (url/address/link) -

android - How to create dynamically Fragment pager adapter -