[代码]main.xml

<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:Android="http://schemas.android.com/apk/res/android"    Android:orientation="vertical" android:layout_width="fill_parent"    Android:layout_height="fill_parent">    <!--  注意这里的Android:id是使用内置的-->    <ListView    Android:id="@android:id/list "                Android:layout_width="fill_parent"                Android:layout_height="wrap_content"></ListView>       </LinearLayout> 

[代码][Java]代码

protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        String[]items ={"aaa","bbbb","cccc"};        ArrayAdapter arrayAdapter = new ArrayAdapter(this,Android.R.layout.simple_list_item_1 ,items);        setListAdapter(arrayAdapter); }

原文详细:http://android.662p.com/thread-493-1-1.html

更多相关文章

  1. 箭头函数的基础使用
  2. NPM 和webpack 的基础使用
  3. Python list sort方法的具体使用
  4. 【阿里云镜像】使用阿里巴巴DNS镜像源——DNS配置教程
  5. Android(安卓)通知的基本用法示例代码
  6. Android软键盘使用
  7. android EditText 去除边框
  8. Android(安卓)使用com.j256.ormlite
  9. android webview字体大小的控制

随机推荐

  1. MySql5.x升级MySql8.x的方法步骤
  2. mysql存储过程之返回多个值的方法示例
  3. MySql Installer 8.0.18可视化安装教程图
  4. mysql存储过程之创建(CREATE PROCEDURE)和
  5. mysql存储过程之引发存储过程中的错误条
  6. Linux下安装MySQL8.0.11的教程
  7. CentOS7下 MySQL定时自动备份的实现方法
  8. mysql 8.0.18各版本安装及安装中出现的问
  9. Windows下mysql-5.7.28下载、安装、配置
  10. Linux下修改MySQL数据库数据文件路径的步