-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathP26.kt
43 lines (38 loc) · 1.25 KB
/
P26.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package alpha.dex.dexsix
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.Menu
import android.view.MenuItem
import android.widget.Toast
class Option : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_option)
}
override fun onCreateOptionsMenu(menu: Menu): Boolean {
menuInflater.inflate(R.menu.optionmenu, menu)
return true
}
override fun onOptionsItemSelected(item: MenuItem): Boolean {
val id = item.itemId
return when (id) {
R.id.Settings -> {
Toast.makeText(applicationContext, "settings Selected", Toast.LENGTH_LONG).show()
true
}
R.id.Play -> {
Toast.makeText(applicationContext, "play Selected", Toast.LENGTH_LONG).show()
true
}
R.id.Pause -> {
Toast.makeText(applicationContext, "pause Selected", Toast.LENGTH_LONG).show()
true
}
R.id.Exit -> {
finish()
true
}
else -> super.onOptionsItemSelected(item)
}
}
}