我正在尝试更改我的应用程序图标,使其与Honeycomb的蓝色相匹配,但保留以前Android版本的绿色图标.我遇到了一个问题,如果我将蓝色72x72图标放在drawable-xlarge中,它会在启动器中正确使用它,但它也会将其用于ActionBar.72x72非常大,它超越了ActionBar的顶部和底部.
我的res目录如下:
drawable - images for ldpi & mdpi screens (48x48)
drawable-hdpi - for hdpi screens (72x72)
drawable-xlarge - just images for tablets
如何正确组织蓝色图标,以便72x72用于启动器,48x48用于ActionBar?
我上周一直在玩Honeycomb,并且很难在Action Bar中找到关于多个下拉列表的内容.我已经使用了本教程并成功添加了一个下拉列表.但我不知道如何添加另一个.如果你知道怎么做,请告诉我.谢谢.
PS还有一点我怎么能改变Action Bar中元素的位置(这是偏离主题的)?
java android android-widget android-3.0-honeycomb android-actionbar
我有这个活动完全转换为使用蜂窝.我重新设计了所有游标管理以使用新的cursorLoader.所有其他操作系统版本(使用兼容性库)的一切都很好用,但仍不适用于蜂窝.以下堆栈跟踪非常难以理解,因为它不会告诉我哪个光标或哪个行失败.此外,在调试时,不会执行ParentActivity中的任何代码行.恢复ParentActivity时会发生此错误.当我开始活动时工作得很好但返回时却失败了.
05-29 17:23:32.978: ERROR/AndroidRuntime(31692): FATAL EXCEPTION: main
05-29 17:23:32.978: ERROR/AndroidRuntime(31692): java.lang.RuntimeException: Unable to resume activity {com.xxx.xxx/com.xxx.xxx.ParentActivity}: java.lang.IllegalStateException: trying to requery an already closed cursor
05-29 17:23:32.978: ERROR/AndroidRuntime(31692): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2227)
05-29 17:23:32.978: ERROR/AndroidRuntime(31692): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2255)
05-29 17:23:32.978: ERROR/AndroidRuntime(31692): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1028)
05-29 17:23:32.978: ERROR/AndroidRuntime(31692): at android.os.Handler.dispatchMessage(Handler.java:99)
05-29 17:23:32.978: ERROR/AndroidRuntime(31692): at android.os.Looper.loop(Looper.java:132)
05-29 17:23:32.978: ERROR/AndroidRuntime(31692): at android.app.ActivityThread.main(ActivityThread.java:4025)
05-29 17:23:32.978: ERROR/AndroidRuntime(31692): at java.lang.reflect.Method.invokeNative(Native Method)
05-29 17:23:32.978: ERROR/AndroidRuntime(31692): at java.lang.reflect.Method.invoke(Method.java:491)
05-29 17:23:32.978: ERROR/AndroidRuntime(31692): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
05-29 17:23:32.978: ERROR/AndroidRuntime(31692): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
05-29 17:23:32.978: ERROR/AndroidRuntime(31692): at dalvik.system.NativeStart.main(Native …Run Code Online (Sandbox Code Playgroud) 我的Android应用程序有一个嵌入视频和音频的WebView.当应用在Android 2.3.x上运行时,视频流和音频播放.
我修改了应用程序以在三星Tab 10.1平板电脑上运行HoneyComb(3.1),视频不流式传输,音频无法播放.在Tab浏览器中输入URL时的视频流.
这是java代码:
mWebView.setWebChromeClient(new WebChromeClient());
mWebView.setWebViewClient(new WebViewClient());
mWebView.getSettings().setAllowFileAccess(true)
mFileName = fileName_items[item_position];
mFullPath = "file:///android_asset/"+mFileName+".html";
mWebView.loadUrl(mFullPath);
Run Code Online (Sandbox Code Playgroud)
在HTML中,我尝试了embed标记和视频标记.嵌入标签不显示任何内容,而视频标签显示控件,我可以切换播放/暂停,但不显示视频.
<video controls="controls" style="align:center;" height="300" width="300">
<source src="http://www.at.com/videos/an1.mp4" type="video/mp4">
</video>
<embed type="video/mp4" src="http://www.at.com/videos/an1.mp4" width="340" height="140" />
Run Code Online (Sandbox Code Playgroud) 谢谢阅读!
一位用户最近报告说他无法在他的华硕Eee Pad变压器上安装我的应用程序(我认为它有3.2更新).
所以,我尝试在3.2模拟器上安装应用程序,这是我的控制台输出:
[2011-08-04 14:04:06 - ] New emulator found: emulator-5554
[2011-08-04 14:04:06 - ] Waiting for HOME ('android.process.acore') to be launched...
[2011-08-04 14:05:04 - ] HOME is up on device 'emulator-5554'
[2011-08-04 14:05:04 - ] Uploading testapp.apk onto device 'emulator-5554'
[2011-08-04 14:05:04 - ] Installing testapp.apk...
[2011-08-04 14:05:34 - ] Installation error: INSTALL_PARSE_FAILED_NOT_APK
[2011-08-04 14:05:34 - ] Please check logcat output for more details.
[2011-08-04 14:05:34 - ] Launch canceled!
Run Code Online (Sandbox Code Playgroud)
有人可以帮我解决这个问题吗?:(
我希望home项看起来像Android 3.0应用程序中ActionBar中的后退按钮.外观类似于Market应用程序(请参阅下面标有红色的屏幕截图):
我知道有一种标准的方法可以在操作栏中的主页按钮中添加"up"可用性.但是还没有看到添加后退箭头的标准方法.有没有一种标准的方法(可能是ActionBar/Activity等的子类化)?如果有人有一个例子或做过这样的事情 - 如果你可以分享它会很好.谢谢.
UPD:如果我使用setDisplayHomeAsUpEnabled(true)它,它会增加一个可用性 - 看左边的一个小箭头:

也许有一种方法可以将这个"向上"箭头设计为"后退"箭头?
我有一个专为Honeycomb设计的应用程序,现在我需要让它在旧的Galaxy Tab(Android 2.2)上运行.
但我使用了一些不属于Froyo API的方法:
//child is a View
child.setPivotX(0);
child.setPivotY(0);
child.setScaleY(scaleFromOriginal);
child.setScaleX(scaleFromOriginal);
Run Code Online (Sandbox Code Playgroud)
有人知道如何在2.2上取得相同的结果?
PS:我正在寻找兼容性包,但这些方法没有帮助.
android android-2.2-froyo android-3.0-honeycomb android-view
我正在使用自定义首选项,我使用标题,摘要和图标.pref用于选择项目(皮肤,应用程序等),然后它将总结当前选择.这是偏好正常工作(上)和我在Honeycomb/ICS上的问题:
正在为首选项创建空间,但即使是默认的标题/摘要也没有显示,项目选择的意图也没有触发.这是首选项布局:
<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+android:id/widget_frame"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeight"
android:gravity="center_vertical"
android:paddingRight="?android:attr/scrollbarSize">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dip"
android:layout_marginRight="6dip"
android:layout_marginTop="6dip"
android:layout_marginBottom="6dip"
android:layout_weight="1">
<TextView
android:id="@+android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:ellipsize="marquee"
android:fadingEdge="horizontal" />
<TextView
android:id="@+android:id/summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@android:id/title"
android:layout_alignLeft="@android:id/title"
android:textAppearance="?android:attr/textAppearanceSmall"
android:maxLines="2" />
</RelativeLayout>
<ImageView
android:id="@+id/icon"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_gravity="center" />
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
而自定义偏好本身:
import android.content.Context;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.graphics.drawable.Drawable;
import android.preference.Preference;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
public class SelectedAppPreference extends Preference {
private Drawable mIcon;
public SelectedAppPreference(Context context, …Run Code Online (Sandbox Code Playgroud) android android-preferences android-layout android-3.0-honeycomb android-4.0-ice-cream-sandwich
我有一个简单的位图,我在画布中绘制并使用矩阵旋转.
我遇到的问题是,使用硬件加速时,边缘在旋转时不会消除锯齿(这与硬件加速关闭时完美配合).当然,像"setDrawFilter"这样的东西是无用的,因为在打开硬件加速时它们会被忽略!
canvas.setDrawFilter(new PaintFlagsDrawFilter(1, Paint.ANTI_ALIAS_FLAG));
Run Code Online (Sandbox Code Playgroud)
我错过了什么或只是硬件渲染方法的限制?还有其他选择吗?
android ×10
android-4.0-ice-cream-sandwich ×1
android-view ×1
cursor ×1
encryption ×1
icons ×1
java ×1
qualifiers ×1
resources ×1
video ×1
webview ×1