Android 开发新手,我正在努力将我的 iOS 应用程序安装到 Android 上。在我的应用程序中,我使用列表视图,效果很好。这就是我到目前为止所拥有的,它在一个 tabwidget 中。
setListAdapter(new ArrayAdapter<String> (this, R.layout.row_style, ITEMS));
ListView lv = getListView();
lv.setTextFilterEnabled(true);
static final String[] ITEMS = new String[] {
"Apple", "Google", "Hewlett Packard", "Adobe"
};
请注意,ITEMS 字符串数组只是虚拟数据。现在这是我的问题,如果用户单击 Apple 我想启动一个名为 AppleActivity 的活动。我怎么能用 onItemClickListener 做到这一点。在 iphone sdk 我可以打电话
如果(objectAtIndex == 0)
我可以做一些类似的事情吗?希望大家能帮忙。
Jonas :) 请注意,ITEMS 字符串数组只是虚拟数据。现在这是我的问题,如果用户单击 Apple 我想启动一个名为 AppleActivity 的活动。我怎么能用 onItemClickListener 做到这一点。在 iphone sdk 我可以打电话
如果(objectAtIndex == 0)
我可以做一些类似的事情吗?希望大家能帮忙。
乔纳斯:)