package com.example.demo11listview;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.widget.ArrayAdapter;
import android.widget.ListView; public class MainActivity extends Activity {
private String data[]={"www.csdn.com","www.baidu.com","wwww.alamps.com","www.iteye.com","www.google.com","www.qq.com"}; private ListView listView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main); this.listView = new ListView(this);
//ArrayAdapter(android.content.Context context, int textViewResourceId, T[] objects)
this.listView.setAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_expandable_list_item_1,this.data)); //note
super.setContentView(this.listView); } @Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
} }

/Users/alamps/AndroidStudioProjects/Demo11ListView的更多相关文章

  1. /Users/alamps/AndroidStudioProjects/Demo10ScrollView

    .define xml <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" andr ...

  2. demo16Toast

    /Users/alamps/AndroidStudioProjects/demo16Toast/demo16Toast/src/main/res/layout/activity_main.xml &l ...

  3. demo14

    /Users/alamps/AndroidStudioProjects/Demo12SimpleAdapter/Demo12SimpleAdapter/src/main/res/layout/tabl ...

  4. Demo12SimpleAdapter

    /Users/alamps/AndroidStudioProjects/Demo12SimpleAdapter/Demo12SimpleAdapter/src/main/res/layout/data ...

  5. Error:C:\Users\issuser\AndroidStudioProjects\SQLiteDemo1\.gradle\buildOutputCleanup\cache.properties (系统找不到指定的文件。)

    android studio报下图中的这个错误的解决办法: 解决办法: 1.删除掉下图中标记的2个文件夹 2.将下图标记的文件的文件名重命名,把最后的后缀.lock去掉,因为加上了这个后缀,所以提示找 ...

  6. mac tomcat

    alampsdeMacBook-Pro:bin alamps$ ./startup.sh Using CATALINA_BASE: /Users/alamps/Library/apache-tomca ...

  7. Android安全攻防战,反编译与混淆技术完全解析(下)

    在上一篇文章当中,我们学习了Android程序反编译方面的知识,包括反编译代码.反编译资源.以及重新打包等内容.通过这些内容我们也能看出来,其实我们的程序并没有那么的安全.可能资源被反编译影响还不是很 ...

  8. 完全卸载AndroidStudio

    一:卸载Android Studio 由于从1.5正式版直接升级到2.1的版本,整个项目构建都变得异常的慢,所以决定卸载重新安装2.0的正式版.但是Mac下使用dmg安装的app很多都是不能使用拖拽的 ...

  9. Andriod学习笔记5:通过NDK在C++中实现日志输出

    开发环境 android studio 1.5.1 实现步骤 新建android项目 项目名称为AndroidCLog,选择Empty Activity模板,其他默认即可. 下载配置ndk 在项目上右 ...

随机推荐

  1. iOS自定义控件开发详解

    http://blog.csdn.net/zhangao0086/article/details/45622875

  2. javaScript中的单引号与双引号

    javaScript中的单引号与双引号没有什么区别.但因为xhtml规范要求所有xhtml属性要用双引号括起来.所以在javaScript中使用单引号. var html = '<h2 clas ...

  3. android判断pad还是手机

    第一种. Rect frame = new Rect(); getWindow().getDecorView().getWindowVisibleDisplayFrame(frame); if (fr ...

  4. 动态页面的登陆——装饰器应用<代码>

    log_status = False f = open("info", "r", encoding="utf8") source = f.r ...

  5. js获取div中的文本框数据

    通过div得到div里的所有数据 大神的世界无需解释,当然不是说我,当我看到这些代码的时候我惊呆了! 这是一个工具方法js: js: /* * 获取指定对象下的所有input.textarea值 * ...

  6. Aptana Studio 3的汉化

    Aptana Studio 3(下面简称Aptana 3)的汉化方法 1.找到这个网站 http://aptana.com/support 2.单击下面的链接 view documentation 在 ...

  7. win7:Remote Desktop Services 启动失败

    背景: 其他PC使用mstsc远程某win7 pro sp1,一直失败. 分析: 影响远程桌面应用的设置有两个: 1. 计算机远程设置中,启用“允许远程协助连接这台计算机”,且远程桌面设置正确.如选择 ...

  8. synzhronized原理3

    1.java中的每个对象都可作为锁,有三种表现形式: 对于普通方法,锁的是当前this对象. 对于静态方法,锁的是class对象 对于方法块,锁的是synchronized指定的对象. 2.JVM基于 ...

  9. iOS GCD简单使用

    Grand Central Dispatch (GCD) 1)运行在主线程的Main queue,通过dispatch_get_main_queue获取. /*!* @function dispatc ...

  10. 【未完待补充】linux 设置So动态库链接路径

    缘起 安装python的包Rtree(Rtree-0.8.2),但需要先安装C语言依赖包spatialindex-src(spatialindex-src-1.8.5).在安装完spatialinde ...