<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>llcc</author_name>
  <author_url>https://blog.hatena.ne.jp/llcc/</author_url>
  <blog_title>しめ鯖日記</blog_title>
  <blog_url>https://llcc.hatenablog.com/</blog_url>
  <categories>
  </categories>
  <description>アプリを閉じた時に通知をセットする方法について下URLを参考に調べてみました developer.android.com 調べた所、通知セットはMainActivityのonStopが良いようです onPauseでも動くのですが、重い処理は途中で停止される事もあるのでonStopの方が確実そうです ちなみにonStopはMainActivityが閉じてからすぐに開いた場合は呼ばれません 具体的には他アプリを開いてそのアプリが落ちてMainActivityに戻る時などです ただこのケースでは再度MainActivityを閉じる時にonStopが呼ばれるので問題はなさそうです 他にはonPause…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fllcc.hatenablog.com%2Fentry%2F2025%2F02%2F24%2F165405&quot; title=&quot;Kotlinでアプリを閉じた時のバックグラウンド処理を動かす - しめ鯖日記&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2025-02-24 16:54:05</published>
  <title>Kotlinでアプリを閉じた時のバックグラウンド処理を動かす</title>
  <type>rich</type>
  <url>https://llcc.hatenablog.com/entry/2025/02/24/165405</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
