티스토리 뷰
<?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"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
<Button android:text="Button" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
</LinearLayout>
package com.antbee.AntListActivity;
import android.app.ListActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListAdapter;
//import android.widget.SimpleAdapter;
public class AntList extends ListActivity{
ListAdapter adapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
adapter = createAdapter();
setListAdapter(adapter); //setView대신 setListAdapter를 사용
}
protected ListAdapter createAdapter() { //adapter = createAdapter(); 될때 내용을 만들도록
// Create some mock data
String[] testValues = new String[] { //리스트 필드 내용을 넣는다.
"Test1",
"Test2",
"Test3"
};
// Create a simple array adapter (of type string) with the test values
ListAdapter adapter = new ArrayAdapter<String>(//어뎁터를 가지고 리스트를 뿌린다.
this,
android.R.layout.simple_list_item_1,
testValues
);
return adapter;
}
}
'Android' 카테고리의 다른 글
android 예제 중 ... throws Exception의 try catch (0) | 2011.03.29 |
---|---|
android startActivityForResult 예제(주석 포함) (0) | 2011.03.29 |
android 내장 UI themes (0) | 2011.03.26 |
안드로이드 앱에서 타이틀 바를 감추기 (0) | 2011.03.26 |
아이폰 블루투스 개발관련. (0) | 2011.03.22 |
- Total
- Today
- Yesterday
- Non-Interactive
- 앱개발
- Android 개발
- LAPM
- json
- 시도 이름
- r
- API
- Linux
- 리눅스
- HTML
- c++
- install
- 안드로이드 개발
- 법정동코드
- 지역고유코드
- 시군구 이름
- JavaScript
- app
- MariaDB
- 안드로이드
- rm으로 삭제
- Android
- delete
- apache
- java
- 파일삭제
- 삭제한 파일 복원
- Tomcat
- MySQL
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |