2

我一直在使用 actionbarsherlock,它运行良好,但我只是在 2.2 模拟器上尝试过,然后将此输出到 DDMS。该应用程序没有机会渲染一次,只是在调用某些 onCreate() 方法后立即关闭。有没有其他人看过这个?:

Style contains key with bad entry: 0x010102ce
Style contains key with bad entry: 0x010102f3
Style contains key with bad entry: 0x010102ce
Style contains key with bad entry: 0x010102f3
VFY: unable to resolve virtual method 4361: Lcom/actionbarsherlock/internal/nineoldandroids/widget/NineFrameLayout;.onHoverEvent (Landroid/view/MotionEvent;)Z
VFY: unable to resolve virtual method 3077: Landroid/widget/FrameLayout;.getAlpha ()F
VFY: unable to resolve virtual method 3078: Landroid/widget/FrameLayout;.getTranslationY ()F
VFY: unable to resolve virtual method 3081: Landroid/widget/FrameLayout;.setAlpha (F)V
VFY: unable to resolve virtual method 3089: Landroid/widget/FrameLayout;.setTranslationY (F)V
VFY: unable to resolve virtual method 317: Landroid/content/pm/PackageManager;.getActivityLogo (Landroid/content/ComponentName;)Landroid/graphics/drawable/Drawable;
VFY: unable to resolve virtual method 313: Landroid/content/pm/ApplicationInfo;.loadLogo (Landroid/content/pm/PackageManager;)Landroid/graphics/drawable/Drawable;
VFY: unable to resolve virtual method 2832: Landroid/view/ViewGroup;.getAlpha ()F
VFY: unable to resolve virtual method 2838: Landroid/view/ViewGroup;.getTranslationX ()F
VFY: unable to resolve virtual method 2839: Landroid/view/ViewGroup;.getTranslationY ()F
VFY: unable to resolve virtual method 2854: Landroid/view/ViewGroup;.setAlpha (F)V
VFY: unable to resolve virtual method 2858: Landroid/view/ViewGroup;.setTranslationX (F)V
VFY: unable to resolve virtual method 2859: Landroid/view/ViewGroup;.setTranslationY (F)V
VFY: unable to resolve virtual method 5290: Lcom/actionbarsherlock/internal/widget/ActionBarView$HomeView;.onHoverEvent (Landroid/view/MotionEvent;)Z
VFY: unable to resolve virtual method 3080: Landroid/widget/FrameLayout;.onPopulateAccessibilityEvent (Landroid/view/accessibility/AccessibilityEvent;)V
ReferenceTable overflow (max=512)
Last 10 entries in JNI local reference table:
  502: 0x43ecaca0 cls=Ljava/lang/String; (28 bytes)
  503: 0x43ecacf0 cls=Ljava/lang/String; (28 bytes)
  504: 0x43ecad40 cls=Ljava/lang/String; (28 bytes)
  505: 0x43ecad90 cls=Ljava/lang/String; (28 bytes)
  506: 0x43ecade0 cls=Ljava/lang/String; (28 bytes)
  507: 0x43ecae30 cls=Ljava/lang/String; (28 bytes)
  508: 0x43ecae80 cls=Ljava/lang/String; (28 bytes)
  509: 0x43ecaed0 cls=Ljava/lang/String; (28 bytes)
  510: 0x43ecaf20 cls=Ljava/lang/String; (28 bytes)
  511: 0x43ecaf70 cls=Ljava/lang/String; (28 bytes)
JNI local reference table summary (512 entries):
    3 of Ljava/lang/Class; 164B (2 unique)
  507 of Ljava/lang/String; 28B (507 unique)
    1 of [Ljava/lang/String; 28B
    1 of [Ljava/lang/String; 2772B
Memory held directly by tracked refs is 17324 bytes
Failed adding to JNI local ref table (has 512 entries)
VM aborting

谢谢

4

1 回答 1

4

这是因为在 API 11 之前布局 simple_list_item_activated_1 不存在(见帖子)。

要让应用程序运行,您可以基于simple_list_item_activated_1创建一个新的列表布局,并在您的代码中使用它。

这是一个启动器:

<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/text1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:gravity="center_vertical"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:minHeight="?android:attr/listPreferredItemHeight"
/>

这可以让代码运行,但它看起来不太正确,因为我删除了

android:background="?android:attr/activatedBackgroundIndicator"

来自 API 11 定义。然后我继续用一些等效的代码替换它 - 见帖子

这里有一个解释问题的教程。

于 2012-08-30T00:37:56.753 回答