Android: Start a new activity from menu item

I'm Trying to open a second screen for my application. The user have to click on a menu item and then the screen must open. But what i try it always just ignores the rule after the case statement. public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.OpenScreen: startActivity(new Intent(this, SecondScreenActivity.class));; break; } return true; I've also added the activity to AndroidManifest.xml inside the tag. Any help will be apreciated ---------- Solution -------- I had the `finish()` in the constructor of the new class.
what is the problem you are facing ? i can't get any problem here.

以上就是Android: Start a new activity from menu item的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏