30 lines
1.0 KiB
Kotlin
30 lines
1.0 KiB
Kotlin
package eu.depau.etchdroid.activities
|
|
|
|
import android.content.Intent
|
|
import android.view.Menu
|
|
import android.view.MenuItem
|
|
import androidx.appcompat.app.AppCompatActivity
|
|
import eu.depau.etchdroid.R
|
|
|
|
abstract class ActivityBase: AppCompatActivity() {
|
|
|
|
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
|
// Inflate the menu; this adds items to the action bar if it is present.
|
|
menuInflater.inflate(R.menu.menu_main, menu)
|
|
return true
|
|
}
|
|
|
|
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
|
// Handle action bar item clicks here. The action bar will
|
|
// automatically handle clicks on the Home/Up button, so long
|
|
// as you specify a parent activity in AndroidManifest.xml.
|
|
return when (item.itemId) {
|
|
R.id.action_licenses -> {
|
|
val intent = Intent(this, LicensesActivity::class.java)
|
|
startActivity(intent)
|
|
return true
|
|
}
|
|
else -> super.onOptionsItemSelected(item)
|
|
}
|
|
}
|
|
} |