登录
首页 » Java » ch04_menu

ch04_menu

于 2010-10-13 发布 文件大小:191KB
0 80
下载积分: 1 下载次数: 21

代码说明:

  android的菜单功能。主要包括菜单项的添加于布局;(android menus. Includes menu items added to the layout )

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • [Java程序设计教程](源码+教案+参考答案)
    【实例简介】 书名《Java程序设计教程》 书号:978-7-302-18214-6 附件中是:电子教案、实例源文件、思考练习参考答案
    2021-08-06 00:30:58下载
    积分:1
  • android短信功能
    android短信功能 核心代码:package cn.edu.siso;import java.util.ArrayList;import java.util.HashMap;import java.util.Iterator;import java.util.List;import javax.xml.parsers.SAXParserFactory;import org.xml.sax.InputSource;import org.xml.sax.XMLReader;import android.app.ListActivity;import android.content.Intent;import android.os.Bundle;import android.view.KeyEvent;import android.view.View;import android.view.Window;import android.widget.Button;import android.widget.ListView;import android.widget.SimpleAdapter;import cn.edu.ContentProvide.Diary.DiaryColumns;import cn.edu.Info.MyInfo;import cn.edu.MyContentHandler.MyContentHandler;import cn.edu.siso.WareHouselistview.SMSBsharpturn;import cn.edu.siso.WareHouselistview.SMSFriendTab;import cn.edu.siso.WareHouselistview.SMSHavefanTab;import cn.edu.siso.WareHouselistview.SMSLoverTab;import cn.edu.siso.WareHouselistview.SMSSchooljoke;import cn.edu.siso.WareHouselistview.SMSapologize;import cn.edu.siso.WareHouselistview.SMShumorjokes;import cn.edu.siso.WareHouselistview.SMSlovewords;import cn.edu.siso.WareHouselistview.SMSmylove;import cn.edu.siso.WareHouselistview.SMSplayful;public class WareHouseActivity extends ListActivity { /** Called when the activity is first created. */ private List mp3Infos=null; private ListView listview; private Button back,updata; public static final String[] PROJECTION = new String[] { DiaryColumns._ID,DiaryColumns.TITLE, DiaryColumns.CREATED }; private Touch touch=new Touch(); @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.warehouse); listview=(ListView) findViewById(android.R.id.list); listview.setScrollingCacheEnabled(false); ShowListView(); back=(Button) findViewById(R.id.back); updata=(Button) findViewById(R.id.updata); back.setOnClickListener(new backlistener()); updata.setOnClickListener(new updatalistener()); back.setOnTouchListener(touch); updata.setOnTouchListener(touch); } private SimpleAdapter budildSimpleAdapter(List mp3Infos){ List list=new ArrayList(); for (Iterator iterator = mp3Infos.iterator(); iterator.hasNext();) { MyInfo mp3Info = (MyInfo) iterator.next(); HashMap map=new HashMap(); map.put("name", mp3Info.getName()); map.put("listimageview", R.drawable.image); list.add(map); } SimpleAdapter listadapter=new SimpleAdapter(this, list, R.layout.textview, new String[]{"name","listimageview"}, new int[]{R.id.houseText,R.id.listimageview}); return listadapter ; } private void ShowListView(){ mp3Infos=pares(R.raw.information); SimpleAdapter listadapter= budildSimpleAdapter(mp3Infos); setListAdapter(listadapter); } public List pares(Object xmlname){ List info=new ArrayList(); try { SAXParserFactory factory=SAXParserFactory.newInstance(); XMLReader reader=factory.newSAXParser().getXMLReader(); MyContentHandler mycontenthandler=new MyContentHandler(info); reader.setContentHandler(mycontenthandler); reader.parse(new InputSource(getResources().openRawResource((Integer) xmlname))); } catch (Exception e) { e.printStackTrace(); } return info; } @Override protected void onListItemClick(ListView l, View v, int position, long id) { // TODO Auto-generated method stub //MyInfo myinfo=mp3Infos.get(position); //System.out.println("myinfo-------" myinfo); Intent intent =new Intent(); switch(position){ case 0: intent.setClass(WareHouseActivity.this, SMSapologize.class); startActivity(intent); break; case 1: intent.setClass(WareHouseActivity.this, SMSmylove.class); startActivity(intent); break; case 2: intent.setClass(WareHouseActivity.this, SMSlovewords.class); startActivity(intent); break; case 3: intent.setClass(WareHouseActivity.this, SMSHavefanTab.class); startActivity(intent); break; case 4: intent.setClass(WareHouseActivity.this, SMSLoverTab.class); startActivity(intent); break; case 5: intent.setClass(WareHouseActivity.this, SMSplayful.class); startActivity(intent); break; case 6: intent.setClass(WareHouseActivity.this, SMSBsharpturn.class); startActivity(intent); break; case 7: intent.setClass(WareHouseActivity.this, SMShumorjokes.class); startActivity(intent); break; case 8: intent.setClass(WareHouseActivity.this, SMSFriendTab.class); startActivity(intent); break; case 9: intent.setClass(WareHouseActivity.this, SMSSchooljoke.class); startActivity(intent); break; case 10: intent.setClass(WareHouseActivity.this, SMSSchooljoke.class); startActivity(intent); break; case 11: intent.setClass(WareHouseActivity.this, SMSSchooljoke.class); startActivity(intent); break; case 12: intent.setClass(WareHouseActivity.this, SMSSchooljoke.class); startActivity(intent); break; case 13: intent.setClass(WareHouseActivity.this, SMSSchooljoke.class); startActivity(intent); break; case 14: intent.setClass(WareHouseActivity.this, SMSSchooljoke.class); startActivity(intent); break; case 15: intent.setClass(WareHouseActivity.this, SMSSchooljoke.class); startActivity(intent); break; case 16: intent.setClass(WareHouseActivity.this, SMSSchooljoke.class); startActivity(intent); break; } super.onListItemClick(l, v, position, id); } @Override public boolean onKeyDown(int keyCode, KeyEvent event) { // TODO Auto-generated method stub if(keyCode==KeyEvent.KEYCODE_BACK&&event.getRepeatCount()==0){ //需要处理 Intent intent =new Intent(); intent.setClass(WareHouseActivity.this, InformationActivityActivity.class); startActivity(intent); finish(); } return false; } class backlistener implements Button.OnClickListener{ @Override public void onClick(View arg0) { // TODO Auto-generated method stub Intent intent = new Intent(); intent.setClass(WareHouseActivity.this,InformationActivityActivity.class); startActivity(intent); finish(); }} class updatalistener implements Button.OnClickListener{ @Override public void onClick(View v) { ShowListView(); }}}
    2014-11-09下载
    积分:1
  • Tbls航空订票系统
    Ø 项目名称———ABS航空订票系统 Ø 项目描述 Ø 航空订票系统手机客户端+网页版 Ø 
    2023-02-13 01:10:04下载
    积分:1
  • Android事务提醒源码
    Android事务提醒源码
    2014-07-28下载
    积分:1
  • HelloWorld,andriod的一个小练习
    helloworld的小程序,基于andriod的应用开发程序,适合初学者进行学习。可以对andriod的布局有个大概的了解。对于初学者通常从最简单的helloworld开始。选择合适的虚拟器进行显示,对andriod中各个文件有初步的了解,以便以后开发应用更为复杂的andriod程序。
    2022-01-26 08:19:50下载
    积分:1
  • struts
    说明:  系统名称:基于struts的图书管理系统 程序说明: 系统开发环境: Windows xp sp2 + myEclipse5.5 + Tomcat6.0 + MySQL5.0 数据库文件:直接将数据库目录下的db_librarySys文件夹复制到mysql数据库的data目录下即可 mysql数据库登陆信息: 帐号root,密码123(自己可以在com.core.ConnDB类中修改) 管理员测试帐号: admin 密码: admin (System Name: struts-based description of the procedures of Library Management System: System Development Environment: Windows xp sp2+ myEclipse5.5+ Tomcat6.0+ MySQL5.0 database file: directly to the database directory db_librarySys folder to mysql database data directory Next to mysql database login information: Account root, the password 123 (the class that they can modify the com.core.ConnDB) Administrator Test Account: admin Password: admin)
    2011-04-11 15:41:38下载
    积分:1
  • 可以新增、查看、删除、借出、归还功能的DVD管理系统
    应用背景用于DVD增加、查看、删除没有或已经有的DVD碟片,同时还可以实现借出、归还等功能。归还中拥有所需交付的手续费等等,在需要关闭系统时也可以关闭系统,但是此程序没有最终完成,只能在特定的环境下运行。关键技术while循环、if条件、if else条件、for循环、各种嵌套。比较精炼。
    2022-11-09 14:45:03下载
    积分:1
  • 某500强android学习资料
    某500强android学习资料
    2015-01-28下载
    积分:1
  • shapjava面向对象设计
    这是一中基于java语言编写的shape框架类,采用了的面向对象的观念,对于软件的扩展和兴建非常有好的知道意义!
    2022-05-01 02:05:31下载
    积分:1
  • cas 之自定义登录
    资源描述之前项目需要多个项目整合实现单点登录,并且保留各自的登录界面,搜索整个网站并没有找到其相关源码,本例自己修改源代码之后编写的cas 自定义登录demo,包含部署的tomcat 启动tomcat就能用。拒绝标题党。良心之作。献给有需要的人。
    2022-01-25 18:37:41下载
    积分:1
  • 696518资源总数
  • 104271会员总数
  • 57今日下载