Questions tagged «options-menu»

6
处理菜单项单击事件-Android
我想创建一个意图,一旦单击菜单项,便会启动新活动,但是我不确定如何执行此操作。我一直在阅读android文档,但是我的实现是不正确的..一些正确方向的指导会有所帮助。我在下面列出了我的代码并注释了我的问题领域,我认为我在调用错误的方法。 package com.jbsoft.SimpleFlashlight; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.*; import android.view.MenuItem.OnMenuItemClickListener; import android.widget.Button; import android.widget.Toast; public class SimpleFlashLightActivity extends Activity { Button GreenButton; // Declare instances of buttons to use later Button BlueButton; private static final int OK_MENU_ITEM = Menu.FIRST; /** Called when the activity is first created. …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.