[+] Start activity on menu click

This commit is contained in:
Azalea Gui
2023-01-23 15:04:43 -05:00
parent 3c88081aed
commit 479b87ca5d
2 changed files with 4 additions and 3 deletions
@@ -1,4 +1,4 @@
package com.welie.blessedexample package org.hydev.wearsync
import android.Manifest import android.Manifest
import android.annotation.SuppressLint import android.annotation.SuppressLint
@@ -25,7 +25,6 @@ import kotlinx.coroutines.flow.consumeAsFlow
import org.hydev.wearsync.bles.BluetoothHandler import org.hydev.wearsync.bles.BluetoothHandler
import org.hydev.wearsync.bles.ObservationUnit import org.hydev.wearsync.bles.ObservationUnit
import org.hydev.wearsync.databinding.ActivityScanBinding import org.hydev.wearsync.databinding.ActivityScanBinding
import org.hydev.wearsync.snack
import timber.log.Timber import timber.log.Timber
import java.text.DateFormat import java.text.DateFormat
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
@@ -2,6 +2,7 @@ package org.hydev.wearsync
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.content.Context import android.content.Context
import android.content.Intent
import android.os.Bundle import android.os.Bundle
import android.view.Menu import android.view.Menu
import android.view.MenuItem import android.view.MenuItem
@@ -40,6 +41,7 @@ class MainActivity : AppCompatActivity()
{ {
// Inflate the menu; this adds items to the action bar if it is present. // Inflate the menu; this adds items to the action bar if it is present.
menuInflater.inflate(R.menu.menu_main, menu) menuInflater.inflate(R.menu.menu_main, menu)
return true return true
} }
@@ -52,7 +54,7 @@ class MainActivity : AppCompatActivity()
{ {
R.id.action_settings -> true R.id.action_settings -> true
R.id.action_scan -> { R.id.action_scan -> {
startActivity(Intent(this, ActivityScan::class.java))
true true
} }
else -> super.onOptionsItemSelected(item) else -> super.onOptionsItemSelected(item)