diff --git a/mobile/src/main/java/net/activitywatch/android/MainActivity.kt b/mobile/src/main/java/net/activitywatch/android/MainActivity.kt index d422465..0c439e0 100644 --- a/mobile/src/main/java/net/activitywatch/android/MainActivity.kt +++ b/mobile/src/main/java/net/activitywatch/android/MainActivity.kt @@ -36,13 +36,6 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - binding = ActivityMainBinding.inflate(layoutInflater) - val view = binding.root - setContentView(view) - - // Set up alarm to send heartbeats - val usw = UsageStatsWatcher(this) - usw.setupAlarm() // If first time, or usage not allowed, show onboarding activity val prefs = AWPreferences(this) @@ -52,6 +45,15 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte startActivity(intent) } + // Set up UI + binding = ActivityMainBinding.inflate(layoutInflater) + val view = binding.root + setContentView(view) + + // Set up alarm to send heartbeats + val usw = UsageStatsWatcher(this) + usw.setupAlarm() + binding.navView.setNavigationItemSelectedListener(this) val ri = RustInterface(this) diff --git a/mobile/src/main/java/net/activitywatch/android/OnboardingActivity.kt b/mobile/src/main/java/net/activitywatch/android/OnboardingActivity.kt index bc5f01a..76d05bf 100644 --- a/mobile/src/main/java/net/activitywatch/android/OnboardingActivity.kt +++ b/mobile/src/main/java/net/activitywatch/android/OnboardingActivity.kt @@ -37,13 +37,22 @@ class OnboardingActivity : AppCompatActivity() { viewPager.adapter = OnboardingAdapter(this) TabLayoutMediator(tabLayout, viewPager) { _, _ -> }.attach() + val nextButton = findViewById