package Ġcom . ate am . her bac rop . ui . view . activity Ċ Ċ import Ġandroid . content . Intent Ċ import Ġandroid . content . SharedPreferences Ċ import Ġandroidx . appcompat . app . AppCompatActivity Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . os . Handler Ċ import Ġandroidx . core . content . edit Ċ import Ġcom . ate am . her bac rop . databinding . Activity Splash Binding Ċ import Ġcom . ate am . her bac rop . ui . view . on boarding . screens . On Board ing Activity Ċ Ċ class ĠSpl ash Activity Ġ: ĠAppCompatActivity () Ġ{ ĊĠĠĠ Ġprivate Ġval Ġsplash TimeOut : ĠLong Ġ= Ġ 3 0 0 0 L ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġsplash Binding : ĠActivity Splash Binding ĊĠĠĠ Ġoverride Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onCreate ( savedInstanceState ) ĊĠĠĠĠĠĠĠ Ġsplash Binding Ġ= ĠActivity Splash Binding . inflate ( layout Inflater ) ĊĠĠĠĠĠĠĠ ĠsetContentView ( splash Binding . root ) ĊĊĠĠĠĠĠĠĠ Ġval Ġshared Preferences : ĠSharedPreferences Ġ= Ġget SharedPreferences (" Preferences ", ĠMODE _ PRIVATE ) ĊĠĠĠĠĠĠĠ Ġval Ġfirst Conditions Ġ: ĠString ? Ġ= Ġshared Preferences . getString (" first _ time ", Ġ"") ĊĊĠĠĠĠĠĠĠ ĠHandler ( main Looper ). post Delayed ({ ĊĠĠĠĠĠĠĠ Ġif Ġ( first Conditions . equals (" Yes ")){ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġintent Ġ= ĠIntent ( this , ĠHome Activity :: class . java ) ĊĠĠĠĠĠĠĠĠĠĠĠ ĠstartActivity ( intent ) ĊĠĠĠĠĠĠĠ Ġ} else { ĊĠĠĠĠĠĠĠĠĠĠĠ Ġshared Preferences . edit Ġ{ Ġput String (" first _ time ", Ġ" Yes ") Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ ĠstartActivity ( Intent ( this , ĠOn Board ing Activity :: class . java )) ĊĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġfinish () ĊĠĠĠĠĠĠĠ Ġ}, Ġsplash TimeOut ) ĊĠĠĠ Ġ} Ċ }