作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我的应用程序的工具栏中添加了“选项”菜单项“选定”。我想在单击项目时添加 Action ,甚至转到其他 Activity 。 l Intent
但不起作用
override fun onOptionsItemSelected(item: MenuItem): {
when (item.itemId) {
R.id.flightarrbeforbgw ->
Intent intent = new Intent(this, FlightsArrivelBeforBGW.class);
this.startActivity(intent)
else ->
return null
}
}
最佳答案
您的意图格式不正确。这是应该的样子:
Intent (this, YourActivity::class.java)
when (item.itemId) {
R.id.flightarrbeforbgw ->{
this.startActivity(Intent(this,FlightsArrivelBeforBGW::class.java))
return true
}
else -> super.onOptionsItemSelected(item)
}
关于kotlin - 在Kotlin中转到菜单项选择上的另一个事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53582783/
我已经在 jQuery transit 中加载了,我确定我是在加载 jQuery 之后才做的,但我仍然得到这个错误: 我查看了 Chrome 中的资源面板,在 jQuery 之后加载了 jQuery
我目前收到一个字符串,例如 Hello there my\r\nName is\r\nJohn Smith\r\nand\r\nstuff 我想将每一行放在一个新列表项...例如: 期望的结果(带有单
我正在尝试使用 MapKit 路线请求获取两个坐标之间的交通路线。 当我切换到其他(非 Transit)类型时,下面的代码可以工作,但是当我切换到 Transit 时,它会抛出一个错误,这个错误在 A
我是一名优秀的程序员,十分优秀!