Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
AppLaunchChecker
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
magiepooh
April 21, 2016
Technology
730
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
AppLaunchChecker
AppLaunchChecker
magiepooh
April 21, 2016
More Decks by magiepooh
See All by magiepooh
今さら角丸のTransition
magiepooh
0
1.5k
Google I/O Extended Tokyo 2018
magiepooh
2
1.7k
APIのデータのマッピングを 約18倍速くした話
magiepooh
2
1.1k
まだAPI定義管理で消耗してるの?〜Swaggerを用いた大規模アプリ時代のAPI定義管理とコードジェネレート〜
magiepooh
38
19k
RootBeer
magiepooh
0
870
Customize Error Message
magiepooh
0
900
Kotlin入門
magiepooh
2
1.9k
Adjust Full Screen
magiepooh
2
560
How to get size of NavigationBar and StatusBar
magiepooh
1
1.8k
Other Decks in Technology
See All in Technology
起点・思考・出力で分解する 〜PM業務の自動化設計〜
kazu_kichi_67
1
1.1k
IaC コードを資産へ:AWS CDK 社内ライブラリと横断展開 / aws-summit-japan-2026
gotok365
10
1.6k
Flow 不死:AI 時代 DevOps 的不變本質
cheng_wei_chen
2
520
WebGIS AI Agentの紹介
_shimizu
0
560
水を運ぶ人としてのリーダーシップ
izumii19
4
1k
【Snowflake Summit 2026 Recap!!】Snowflake Summit Deep Dive: Security & Governance
civitaspo
1
320
從開發到部署全都交給 AI:實作 AI 驅動的自動化流程
appleboy
0
170
iOS アプリの「これって不具合ですか?」を AI に調べてもらう
miichan
0
140
自分が詳しくない領域でAIを使う #プロヒス2026
konifar
20
7.5k
AIチャット検索改善の3週間
kworkdev
PRO
2
180
Lightning近況報告
kozy4324
0
220
AIペネトレーションテスト・ セキュリティ検証「AgenticSec」紹介資料
laysakura
2
7.6k
Featured
See All Featured
Technical Leadership for Architectural Decision Making
baasie
3
420
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
170
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Believing is Seeing
oripsolob
1
150
Building Applications with DynamoDB
mza
96
7.1k
Utilizing Notion as your number one productivity tool
mfonobong
4
330
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
250
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
160
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
170
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
240
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
11k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
620
Transcript
AppLaunchChecker @magiepooh
About me @magiepooh @magie_pooh Takuma Fujita
Company AbemaTV, Inc. (Cyber Agent, Inc.)
AppLaunchChecker
?
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); AppLaunchChecker.hasStartedFromLauncher(this); // =>
false }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); AppLaunchChecker.onActivityCreate(this); AppLaunchChecker.hasStartedFromLauncher(this); //
=> true }
public static boolean hasStartedFromLauncher(Context context) { return context.getSharedPreferences(SHARED_PREFS_NAME, 0) .getBoolean(KEY_STARTED_FROM_LAUNCHER,
false); } public static void onActivityCreate(Activity activity) { final SharedPreferences sp = activity.getSharedPreferences(SHARED_PREFS_NAME, 0); if (sp.getBoolean(KEY_STARTED_FROM_LAUNCHER, false)) { return; } final Intent launchIntent = activity.getIntent(); if (launchIntent == null) { return; } if (Intent.ACTION_MAIN.equals(launchIntent.getAction()) && (launchIntent.hasCategory(Intent.CATEGORY_LAUNCHER) || launchIntent.hasCategory(IntentCompat.CATEGORY_LEANBACK_LAUNCHER))) { SharedPreferencesCompat.EditorCompat.getInstance().apply( sp.edit().putBoolean(KEY_STARTED_FROM_LAUNCHER, true)); } } AppLaunchChecker.java
public static boolean hasStartedFromLauncher(Context context) { return context.getSharedPreferences(SHARED_PREFS_NAME, 0) .getBoolean(KEY_STARTED_FROM_LAUNCHER,
false); } public static void onActivityCreate(Activity activity) { final SharedPreferences sp = activity.getSharedPreferences(SHARED_PREFS_NAME, 0); if (sp.getBoolean(KEY_STARTED_FROM_LAUNCHER, false)) { return; } final Intent launchIntent = activity.getIntent(); if (launchIntent == null) { return; } if (Intent.ACTION_MAIN.equals(launchIntent.getAction()) && (launchIntent.hasCategory(Intent.CATEGORY_LAUNCHER) || launchIntent.hasCategory(IntentCompat.CATEGORY_LEANBACK_LAUNCHER))) { SharedPreferencesCompat.EditorCompat.getInstance().apply( sp.edit().putBoolean(KEY_STARTED_FROM_LAUNCHER, true)); } } AppLaunchChecker.java
• SharedPreferencesʹΠϯςϯτͷΞΫγϣϯ ͱ͔ΧςΰϦͱ͔ݟͯϥϯνϟʔ͔Βىಈ͠ ͔ͨΛॻ͖ࠐΜͰΔ͚ͩ • SharedPreferencesͷΛϦηοτ͢Δͷ ༻ҙ͞Ε͍ͯͳ͍
• Πϯετʔϧ > Launcherىಈ // true • Πϯετʔϧ > DeepLink
// false • Πϯετʔϧ > Launcherىಈ > DeepLink // true ݁ɿ
݁ɿ • Πϯετʔϧ > Launcherىಈ // true • Πϯετʔϧ >
DeepLink // false • Πϯετʔϧ > Launcherىಈ > DeepLink // true աڈʹϢʔβ͕ҰͰLauncher͔Βىಈ͔ͨ͠Ͳ͏͔
݁ɿ Ͳ͜Ͱ͑Δ͔શ͘ Θ͔ΒΜɻ