我正在寻找一种方法来定期动画/自动推进ListView应用程序小部件,就像使用StackView应用程序小部件一样.
例如,Android Market和YouTube小部件通过自动前进到集合中的下一个项目(在Honeycomb上)每20秒进行一次动画制作.
我在StackView Widget示例中看到他们对StackView小部件使用autoAdvanceViewId设置:
<appwidget-provider
xmlns:android="http://schemas.android.com/apk/res/android"
android:minWidth="150dip"
android:minHeight="150dip"
android:updatePeriodMillis="3600000"
android:previewImage="@drawable/preview"
android:initialLayout="@layout/widget_layout"
android:autoAdvanceViewId="@id/stack_view">
</appwidget-provider>
Run Code Online (Sandbox Code Playgroud)
是否可以以某种方式为ListView应用程序小部件完成或模拟?
非常感谢,
劳伦特
我在ActionBar中使用导航控件来提供下拉列表.我想在某些情况下禁用选择下拉列表.
我的微调器适配器关闭视图的布局TextView包含在一个LinearLayout.最好的我想出来的是压倒getView在我的飞旋的适配器,使两者的LinearLayout和TextView非可点击和残疾人.这具有使文本变灰的效果,但仍然可以选择它.
编辑我很欣赏我可以隐藏列表,但这不是我想要做的.此外,我在方法中返回false,检查是否启用了一个或所有项目,但这不起作用.
尝试在Xoom上使用Honeycomb.提前致谢.彼得.
我的基本问题是:开发Android应用程序与android 2.2 SDK是否适用于在Honeycomb(android 3.0)和更高版本上运行的Android平板电脑?
此外,为手机开发的应用程序是否适用于平板电脑
Adithya.
昨晚花了几个小时为Honeycomb开发了一个非常甜美的视频播放器,现在我当然喜欢能够使用它的人.
如何让我的应用程序监听/接收"视频播放广播"?
我猜这与manifest.xml文件有关,但我无法在Android开发者网站上找到任何关于它的信息.
我尝试使用以下内容但没有取得多大成功:
<receiver android:name=".VideoPlayer">
<intent-filter>
<action android:name="android.intent.action.VIEW">
<data android:mimeType="video/*" />
</action>
</intent-filter>
</receiver>
Run Code Online (Sandbox Code Playgroud) 我已经以LinearLayout areaForGalleries编程方式Gallery一个接一个地填充了组件.onItemClick每个库中的方法将其从中移除areaForGalleries并将其添加到RelativeLayout parentLayout其中areaForGalleries.见下面的代码.
LinearLayout areaForGalleries;
RelativeLayout parentLayout;
...
private void showGallery() {
final CustomGallery mGallery = new CustomGallery(mContext);
mGallery.setOnItemClickListener(new CustomAdapterView.OnItemClickListener() {
public void onItemClick(CustomAdapterView<?> parent, View v, int position, long id) {
areaForGalleries.removeView(mGallery);
parentLayout.addView(mGallery);
}
});
Run Code Online (Sandbox Code Playgroud)
CustomGallery是我的Android Gallery组件实现.我只更改了左侧图库的对齐方式 - 一行代码已更改.代码在Android 2.1 - 2.3.3上完美运行,但是当在Honeycomb或ICS上尝试时,它崩溃并出现以下错误:
01-31 10:31:49.596: E/AndroidRuntime(1536): FATAL EXCEPTION: main
01-31 10:31:49.596: E/AndroidRuntime(1536): java.lang.NullPointerException
01-31 10:31:49.596: E/AndroidRuntime(1536): at android.view.GestureDetector.onTouchEvent(GestureDetector.java:587)
01-31 10:31:49.596: E/AndroidRuntime(1536): at com.my.example.pullrefreshgallery.CustomGallery.onTouchEvent(CustomGallery.java:812)
01-31 10:31:49.596: E/AndroidRuntime(1536): …Run Code Online (Sandbox Code Playgroud) android add nullpointerexception android-gallery android-3.0-honeycomb
我的问题:我可以支持更老的api并使用更新api的功能吗?
我的情况:我正在构建一个简单的应用程序,我希望通过UI支持一些高级功能(如果可用).但我支持的API级别是13,所以我可以支持Android 3.2.具体来说,我想使用View.SYSTEM_UI_FLAG_*变量,但这些变量在api 13级中不可用.
android android-3.0-honeycomb android-4.0-ice-cream-sandwich
我希望ActionBar中的所有选项卡都有不同的颜色指示器,例如蓝色表示选项卡1,红色表示选项卡2等.
为了达到这个目的,我确实为所有颜色创建了不同的选择器,并将它们放在不同的xmls中.在style.xml中,我正在调用它们
<style name="MyTheme" parent="AppBaseTheme">
<item name="android:actionBarTabStyle">@style/ActionBarTabStyleRed</item>
</style>
<style name="ActionBarTabStyleRed">
<item name="android:background">@drawable/tab_indicator_red</item>
</style>
Run Code Online (Sandbox Code Playgroud)
我也为不同的颜色创造了这种风格.现在,当我将drawable或样式更改为不同的颜色时,它可以正常工作.我可以看到应用于标签的颜色.但由于所有标签都是相同的颜色,它并没有解决我的目的.我尝试设置标签的样式,onTabSelected()但没有方法可以做到这一点.
最终我尝试为不同的颜色创建不同的主题,并尝试以编程方式设置它们onTabSelected(),但后来我知道必须先设置主题setContentView().
所以我的问题是......我怎么能这样做?有什么办法可以为不同的标签指示器设置不同的颜色???
更新: -
drawable/tab_indicator_red.xml
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Non focused states -->
<item android:state_focused="false" android:state_selected="false" android:state_pressed="false" android:drawable="@android:color/transparent" />
<item android:state_focused="false" android:state_selected="true" android:state_pressed="false" android:drawable="@drawable/tab_selected_red" />
<!-- Focused states -->
<item android:state_focused="true" android:state_selected="false" android:state_pressed="false" android:drawable="@drawable/tab_unselected_focused_red" />
<item android:state_focused="true" android:state_selected="true" android:state_pressed="false" android:drawable="@drawable/tab_selected_focused_red" />
<!-- Pressed -->
<!-- Non focused states -->
<item android:state_focused="false" android:state_selected="false" android:state_pressed="true" android:drawable="@drawable/tab_unselected_pressed_red" />
<item android:state_focused="false" android:state_selected="true" android:state_pressed="true" android:drawable="@drawable/tab_selected_pressed_red" /> …Run Code Online (Sandbox Code Playgroud) 我有一个用于使用 helm 创建 terraform 资源的文件helm.tf。
在这个文件中,我创建了一个蜂窝代理,需要传入一些观察者,所以我使用了一个 yaml 文件进行配置。这是 helm.tf 的片段:
resource "helm_release" "honeycomb" {
version = "0.11.0"
depends_on = [module.eks]
repository = "https://honeycombio.github.io/helm-charts"
chart = "honeycomb"
name = "honeycomb"
values = [
file("modules/kubernetes/helm/honeycomb.yml")
]
}
Run Code Online (Sandbox Code Playgroud)
这是yaml文件
agent:
watchers:
- labelSelector: "app=my-app"
namespace: my-namespace
dataset: {{$env}}
parser:
name: nginx
dataset: {{$env}}
options:
log_format: "blah"
Run Code Online (Sandbox Code Playgroud)
不幸的是,我尝试设置变量的尝试{{$x}}没有奏效,那么我将如何将env变量发送到 yaml 值文件?我在 tf 文件中有可用的变量,但不确定如何在值文件中设置它。
谢谢
我遇到了应用冻结的一些问题.看起来它与hardwarerenderer有关,也许与我正在使用的线程数量有关.我喜欢有人看看日志,并告诉我是否有任何明显的指出.谢谢.
DALVIK THREADS:
(mutexes: tll=0 tsl=0 tscl=0 ghl=0 hwl=0 hwll=0)
"main" prio=5 tid=1 NATIVE
| group="main" sCount=1 dsCount=0 obj=0x401f6600 self=0x125f8
| sysTid=15811 nice=0 sched=0/0 cgrp=default handle=-1345129368
| schedstat=( 0 0 0 ) utm=2495 stm=1172 core=0
at com.google.android.gles_jni.EGLImpl.eglSwapBuffers(Native Method)
at android.view.HardwareRenderer$GlRenderer.draw(HardwareRenderer.java:648)
at android.view.ViewRoot.draw(ViewRoot.java:1594)
at android.view.ViewRoot.performTraversals(ViewRoot.java:1410)
at android.view.ViewRoot.handleMessage(ViewRoot.java:2040)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:132)
at android.app.ActivityThread.main(ActivityThread.java:4123)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:491)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
at dalvik.system.NativeStart.main(Native Method)
"Thread-811" prio=5 tid=31 VMWAIT
| group="main" sCount=1 dsCount=0 obj=0x412479c0 self=0x45e478
| sysTid=17073 nice=0 sched=0/0 cgrp=default handle=2020736 …Run Code Online (Sandbox Code Playgroud) 通过Android SDK和AVD Manager,我创建了一个android3.0版本的AVD,尺寸选项为1024MiB.在我的应用程序类中,我已经要求创建一个目录,以便我可以缓存图像.但我在那里得到错误
09-07 15:32:31.253: ERROR/AndroidRuntime(380): Caused by: java.lang.IllegalStateException: Unable to create nomedia file.
Run Code Online (Sandbox Code Playgroud)
我的代码是:
File baseDirectory = new File(Environment.getExternalStorageDirectory(), "myapp");
File storageDirectory = new File(baseDirectory, "imagecache");
File nomediaFile = new File(storageDirectory, NOMEDIA);
nomediaFile.createNewFile();
Run Code Online (Sandbox Code Playgroud)
错误在第4行出现.有人可以帮帮我吗.我是蜂窝状的新手.提前致谢.
android ×9
add ×1
amazon-eks ×1
android-4.0-ice-cream-sandwich ×1
animation ×1
tabs ×1
terraform ×1
timeout ×1
video ×1