登录
首页 » Java » android RelativeLayout 布局 实例

android RelativeLayout 布局 实例

于 2013-03-16 发布
0 98
下载积分: 1 下载次数: 0

代码说明:

android RelativeLayout 布局 实例

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

发表评论

0 个回复

  • 基于JBox2D的 android 游戏源码例子(完整版下载)
    基于JBox2D的 android 游戏开发源码例子(完整版下载)
    2014-09-19下载
    积分: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
  • android 抽屉效果实例源码下载(可以滑动)
    android 抽屉效果实例源码下载(可以滑动)
    2014-12-28下载
    积分:1
  • 高并秒杀系统源码(基于springboot高并秒杀系统的实现)
    2020年常用的java框架实现
    2020-03-03下载
    积分:1
  • android 转盘抽奖实例源码下载
    android 转盘抽奖实例源码下载
    2014-06-17下载
    积分:1
  • android 唐诗宋词 app 完整源码下载
    android 唐诗宋词 app 完整源码下载
    2015-05-16下载
    积分:1
  • android 底部tab切换 例子代码
    android 底部tab切换 例子代码
    2020-12-16 16:29:12下载
    积分:1
  • android 手机上调用插件打网页 示例代码
    手机上调用插件打开网页
    2015-03-13下载
    积分:1
  • android win8界面风格扁化设计点击动画效果实例源码下载
    android win8界面风格扁平化设计点击动画效果实例源码下载
    2014-08-24下载
    积分:1
  • android SharedPreferences数据存储 增删改例子源码
    android SharedPreferences数据存储 增删改例子源码
    2015-02-15下载
    积分:1
  • 696518资源总数
  • 104225会员总数
  • 32今日下载