Close Kodi Properly (Programmaticaly) in Android

On android:
Any BroadcastReceivers or any other methods ? Help Nod

How close kodi in android by NOT this way:

Code:
kill $(pgrep org.xbmc.kodi)

from java android application?