如何获取列表视图与Android中自定义适配器的位置? [英] How to get the position of listview with custom Adapter in Android?

查看:278
本文介绍了如何获取列表视图与Android中自定义适配器的位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发一个应用程序。

我的布局,画面如下:

在我使用过的水平列表视图作为图像。

In that I had Used horizontal Listview for Images.

我的要求是:

当我点击 preVIEW按钮图片这是目前在屏幕上显示应传递给另一个活动作为一个网址。但怎么可能我也实在没有想法。

When I click on Preview Button the image which are currently displaying on screen should pass to another Activity as a URL. but how it can be possible I have really no idea.

推荐答案

在哪里保存你的形象?在设备中的资源文件夹?在互联网上?为什么你需要把它作为一个URL?

Where is your image stored? in the resources folder in your device? On Internet? Why you need to pass it as a URL?

有不同的方式。有额外发送意图可能做的伎俩。你可以把URL作为字符串或也通过图像的位置为String。

There are different ways. Sending intents with extras may do the trick. You can put the URL as a String or pass the location of the image also as String.

反正添加更多的信息,有关布局,我可以更新我的答案给你更多的建议。

Anyway add more information about the layout and I could update my answer to give you more advices.

这篇关于如何获取列表视图与Android中自定义适配器的位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆