Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
onPause()イベントを使用して、メソッドを使用してMediaPlayerを停止できることを知っていますreset()。しかし、戻るボタンを押してもメディアプレーヤーがまだ再生されている理由を知りたいのですが。
onPause()
reset()
あなたのメディアプレーヤーはサービスによって運営されていると思います。したがって、戻るキーを押すと、サービスではなくアクティビティのみが破棄されます。したがって、アクティビティのonStopメソッドでもサービスを停止する必要があります
メディアの再生を停止できます
onBackPress() メソッド...