【发布时间】:2017-11-02 22:32:23
【问题描述】:
我正在制作一个 android 应用程序,我有 4 个文本视图,即 ProductId、Title、description、image。我希望在单击每一个时都应显示产品 ID。我为此提供了一个网络服务。
webservice 的输出是
vmsc>
<response code="0" message="Success"/>
−
<responsedata>
−
<productcategories>
−
<productcategory>
<id>1</id>
<title>Celebrities</title>
<description>Celebrities</description>
<image>
</image>
</productcategory>
−
<productcategory>
<id>2</id>
<title>Music</title>
<description>Music</description>
<image>
</image>
</productcategory>
−
<productcategory>
<id>3</id>
<title>Sports</title>
<description>Sports</description>
<image>
</image>
</productcategory>
−
<productcategory>
<id>4</id>
<title>Fashion</title>
<description>Fashion</description>
<image>
</image>
</productcategory>
−
<productcategory>
<id>5</id>
<title>Religion</title>
<description>Religion</description>
<image>
</image>
</productcategory>
−
<productcategory>
<id>6</id>
<title>Others</title>
<description>Others</description>
<image>
</image>
</productcategory>
</productcategories>
</responsedata>
</vmsc>
提前致谢 图沙尔
【问题讨论】:
-
这里的问题是什么?到目前为止,您尝试过什么?
-
我创建了一个包含 4 个文本的 xml。这是我的 java 代码
-
如果我理解正确的话,您想为每个 TextView 定义一个 ClickListener,例如,它可以显示一个带有 Product ID 的烤面包机。
标签: android