如何设置一个ListView成一个appwidget? [英] how to set a listview into an appwidget?

查看:173
本文介绍了如何设置一个ListView成一个appwidget?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建中,我想从列表视图中的资源显示一些数据的appwidget。我在Android的新的,所以我没有得到任何想法。请帮助

I want to create an appwidget in which I want to show some data from a resource in a list view. I am new in android so I am not getting any idea. Please help

由于提前

推荐答案

基本上你不能用一个ListView与手机应用程序部件。这不是一个受支持的View(适用于支持的人的名单,看看这里 )。

Basically you can't use a ListView with an app widget on phones. It's not a supported View (for a list of supported ones, look here).

真正的故事是一个比较复杂一点,有两个例外情况:

The true story is a bit more complicated, there are two exceptions to this rule:

首页的,你可以用它在Honeycomb(Android 3.0以上版本),不过目前只有那粒。我从来没有这个工作,从短检索,文档似乎有点缺乏的,发现几乎没有任何的这个(这是的下的Andr​​oid 3.0平台API概述应用小工具 - 也有链接到几样)

First, you can use it on Honeycomb (Android 3.0+), but thats only tablets at the moment. I never have worked with this and from a short search, the doc seems a bit lacking here, found hardly any evidence of this (it's noted inside the Android 3.0 Platform API overview under "App widgets" - there are also links to a few samples).

的,一些替代发射器不支持的ListView。我不知道到底是哪些,继承人在Android市场从纯使者部件说明报价:

Second, some alternative launchers do support the ListView. I don't know exactly which ones, heres a quote from the "Pure messenger widget" description in the Android market:

滚动部件用最另类的发射像ADW,LiveHome,
  GO桌面或的LauncherPro

Scrollable widget with most alternative launchers like ADW, LiveHome, Go Launcher Ex or LauncherPro

这意味着你可以从市场安装大多数自定义发射器。
它不包括专有发射器支持列表视图在一个未公开的方式 - 例如, HTC Sense的。

That means most custom launchers that you can install from the Market. It does not include proprietary launchers which support ListViews in an undocumented manner - e.g. HTC Sense.

我不知道如果你能做到的ALT-发射了一些兼容性测试。您可以使用资源说明符蜂窝设备从静止分裂,但即使如此,你仍然是从厂家的许多香草设备或默认的发射器不兼容。

I'm not sure if you can do some compatibility testing for alt-launchers. You may use res specifiers to split Honeycomb devices from the rest, but even then you are still incompatible with many vanilla devices or default launchers from the manufacturers.

要总结:它是目前列表视图一个非常糟糕的情况。

To sum it up: It's a very bad situation for ListViews at the moment.

(弱替代:。当然,你可以建立一个假列表视图,看起来像一个名单,但它是一个静态布局出了支持的意见,但不会滚动)

(Weak alternative: Of course you can build a "fake listview" that looks like a list, but is a static layout out of the supported Views. But that won't scroll.)

注:我知道这是不是如何真正做到这一点更是你能的答案 - 这是实际问题。我认为它还是有用的,因为它是一个奇怪的局面。你经常看到列表视图的工作,但你不能让它运行可以迷惑人的新的平台。我希望这是明确的,当你能够使用它。

Note: I'm aware that this is more of an "can you" answer than how to actually do it - which is the actual question. I think it's still useful since it is a weird situation. You see often that ListViews work, but you can't get it to run which may confuse people new to the platform. I hope this makes clear, when you are able to use it.

这篇关于如何设置一个ListView成一个appwidget?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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