Created
November 1, 2009 06:30
-
-
Save hyoromo/223418 to your computer and use it in GitHub Desktop.
ListViewSample01
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package jp.ne.hyoromo.android.DemoView; | |
import android.app.Activity; | |
import android.os.Bundle; | |
import android.widget.ArrayAdapter; | |
import android.widget.ListView; | |
/** | |
* シンプルListView01 | |
* カスタマイズなしのListView | |
* | |
* @author hyoromo | |
* | |
*/ | |
public class DemoView01 extends Activity { | |
// アダプター設定リスト | |
private String[] mData = { "red", "yellow", "blue", "green", "pearl", "gold", "silver" }; | |
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.main); | |
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, mData); | |
ListView listView = (ListView) findViewById(R.id.list); | |
listView.setAdapter(adapter); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="fill_parent" | |
android:layout_height="fill_parent" | |
android:orientation="vertical"> | |
<ListView | |
android:id="@+id/list" | |
android:layout_width="fill_parent" | |
android:layout_height="fill_parent" | |
android:drawSelectorOnTop="false" /> | |
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content"> | |
<TextView | |
android:id="@+id/TextView01" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" /> | |
</LinearLayout> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment