下你所需,载你所想!
汇集开发技术源码资料

android gridview实例

:39.112KB :1 :2021-11-29 20:37:51

部分简介

android gridview实例对于感兴趣的可以参考。
package com.test;

import android.app.Activity;
import android.os.Bundle;

public class MainActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

String strs[] = new String[] { "aaaaa", "bbbb", "ccccc", "dddddddddddd" };

android.widget.ArrayAdapter arrayAdapter = new android.widget.ArrayAdapter(
this, android.R.layout.simple_list_item_1, strs);

android.widget.GridView gridView = (android.widget.GridView) this
.findViewById(R.id.grid1);

gridView.setAdapter(arrayAdapter);
}
}

android gridview实例

热门推荐

相关文章