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

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

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -