2

Hello im trying to use holoeverywhere with actionbarsherlock.

My problem is that on low android version (i tried on SDK 8) i get strange errors.

10-16 11:28:16.455: E/ResourceType(427): Style contains key with bad entry: 0x010102cd
10-16 11:28:16.455: E/ResourceType(427): Style contains key with bad entry: 0x010102dd
10-16 11:28:16.455: E/ResourceType(427): Style contains key with bad entry: 0x010102f0
10-16 11:28:16.455: E/ResourceType(427): Style contains key with bad entry: 0x010102cd
10-16 11:28:16.455: E/ResourceType(427): Style contains key with bad entry: 0x010102dd
10-16 11:28:16.455: E/ResourceType(427): Style contains key with bad entry: 0x010102f0
10-16 11:28:16.605: D/AndroidRuntime(427): Shutting down VM
10-16 11:28:16.605: W/dalvikvm(427): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
10-16 11:28:16.624: E/AndroidRuntime(427): FATAL EXCEPTION: main
10-16 11:28:16.624: E/AndroidRuntime(427): java.lang.ClassCastException: android.widget.RelativeLayout$LayoutParams
10-16 11:28:16.624: E/AndroidRuntime(427):  at android.widget.ListView.measureScrapChild(ListView.java:1117)
10-16 11:28:16.624: E/AndroidRuntime(427):  at android.widget.ListView.measureHeightOfChildren(ListView.java:1200)
10-16 11:28:16.624: E/AndroidRuntime(427):  at android.widget.ListView.onMeasure(ListView.java:1109)
10-16 11:28:16.624: E/AndroidRuntime(427):  at android.view.View.measure(View.java:8171)
10-16 11:28:16.624: E/AndroidRuntime(427):  at android.widget.RelativeLayout.measureChild(RelativeLayout.java:563)
10-16 11:28:16.624: E/AndroidRuntime(427):  at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:378)
10-16 11:28:16.624: E/AndroidRuntime(427):  at android.view.View.measure(View.java:8171)
10-16 11:28:16.624: E/AndroidRuntime(427):  at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3132)
10-16 11:28:16.624: E/AndroidRuntime(427):  at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)
10-16 11:28:16.624: E/AndroidRuntime(427):  at android.view.View.measure(View.java:8171)
10-16 11:28:16.624: E/AndroidRuntime(427):  at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3132)
10-16 11:28:16.624: E/AndroidRuntime(427):  at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)
10-16 11:28:16.624: E/AndroidRuntime(427):  at android.view.View.measure(View.java:8171)
10-16 11:28:16.624: E/AndroidRuntime(427):  at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3132)
10-16 11:28:16.624: E/AndroidRuntime(427):  at org.holoeverywhere.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:594)
10-16 11:28:16.624: E/AndroidRuntime(427):  at org.holoeverywhere.widget.LinearLayout.measureVertical(LinearLayout.java:913)
10-16 11:28:16.624: E/AndroidRuntime(427):  at org.holoeverywhere.widget.LinearLayout.onMeasure(LinearLayout.java:1105)
10-16 11:28:16.624: E/AndroidRuntime(427):  at android.view.View.measure(View.java:8171)
10-16 11:28:16.624: E/AndroidRuntime(427):  at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3132)
10-16 11:28:16.624: E/AndroidRuntime(427):  at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)
10-16 11:28:16.624: E/AndroidRuntime(427):  at org.holoeverywhere.internal.WindowDecorView.onMeasure(WindowDecorView.java:114)
10-16 11:28:16.624: E/AndroidRuntime(427):  at android.view.View.measure(View.java:8171)
10-16 11:28:16.624: E/AndroidRuntime(427):  at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3132)
10-16 11:28:16.624: E/AndroidRuntime(427):  at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)
10-16 11:28:16.624: E/AndroidRuntime(427):  at android.view.View.measure(View.java:8171)
10-16 11:28:16.624: E/AndroidRuntime(427):  at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3132)
10-16 11:28:16.624: E/AndroidRuntime(427):  at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)
10-16 11:28:16.624: E/AndroidRuntime(427):  at android.view.View.measure(View.java:8171)
10-16 11:28:16.624: E/AndroidRuntime(427):  at android.view.ViewRoot.performTraversals(ViewRoot.java:801)
10-16 11:28:16.624: E/AndroidRuntime(427):  at android.view.ViewRoot.handleMessage(ViewRoot.java:1727)
10-16 11:28:16.624: E/AndroidRuntime(427):  at android.os.Handler.dispatchMessage(Handler.java:99)
10-16 11:28:16.624: E/AndroidRuntime(427):  at android.os.Looper.loop(Looper.java:123)
10-16 11:28:16.624: E/AndroidRuntime(427):  at android.app.ActivityThread.main(ActivityThread.java:4627)
10-16 11:28:16.624: E/AndroidRuntime(427):  at java.lang.reflect.Method.invokeNative(Native Method)
10-16 11:28:16.624: E/AndroidRuntime(427):  at java.lang.reflect.Method.invoke(Method.java:521)
10-16 11:28:16.624: E/AndroidRuntime(427):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
10-16 11:28:16.624: E/AndroidRuntime(427):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
10-16 11:28:16.624: E/AndroidRuntime(427):  at dalvik.system.NativeStart.main(Native Method)

My layout XML:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/mainLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/background" >

    <TextView
        android:id="@+id/refreshText"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:background="@color/white"
        android:gravity="center"
        android:text="Refreshing..."
        android:textColor="@color/Black"
        android:textSize="20sp"
        android:visibility="gone" />

    <com.example.workoutlog.WallScrollView
        android:id="@+id/wallList"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/refreshText"
        android:stackFromBottom="true"
        android:transcriptMode="alwaysScroll" >

        <LinearLayout
            android:id="@+id/workoutsWall"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical" >
        </LinearLayout>
    </com.example.workoutlog.WallScrollView>

    <LinearLayout
        android:id="@+id/swipeLayOut2"
        android:layout_width="110sp"
        android:layout_height="match_parent"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:background="@color/Black"
        android:orientation="vertical"
        android:visibility="gone" >

        <Button
            android:id="@+id/goHomePage"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="home page"
            android:textColor="@color/Black"
            android:textSize="15sp" />

        <Button
            android:id="@+id/goCalendar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="Calendar"
            android:textColor="@color/Black"
            android:textSize="15sp" />

        <Button
            android:id="@+id/goToday"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="Today log"
            android:textColor="@color/Black"
            android:textSize="15sp" />

        <Button
            android:id="@+id/goLive"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="live workout"
            android:textColor="@color/Black"
            android:textSize="15sp" />

        <Button
            android:id="@+id/goRoutine"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="Routines"
            android:textColor="@color/Black"
            android:textSize="15sp" />

        <Button
            android:id="@+id/goProgram"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="Program plan"
            android:textColor="@color/Black"
            android:textSize="15sp" />

        <Button
            android:id="@+id/goPersonal"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="Pesonal detials"
            android:textColor="@color/Black"
            android:textSize="15sp" />

        <Button
            android:id="@+id/goWorkout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="Set workout"
            android:textColor="@color/Black"
            android:textSize="15sp" />

        <Button
            android:id="@+id/goStatistics"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="Statistics"
            android:textColor="@color/Black"
            android:textSize="15sp" />

        <Button
            android:id="@+id/goDiet"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="Diet log"
            android:textColor="@color/Black"
            android:textSize="15sp" />
    </LinearLayout>

    <com.example.workoutlog.VerticalTextView
        android:id="@+id/swipeImage"
        android:layout_width="wrap_content"
        android:layout_height="63dp"
        android:layout_toRightOf="@+id/swipeLayOut2"
        android:background="@color/red"
        android:text="swipe right"
        android:textColor="@color/Black"
        android:textSize="18sp"
        android:visibility="gone" />

    <ProgressBar
        android:id="@+id/loadingProgress"
        style="?android:attr/progressBarStyleLarge"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"
        android:indeterminateDrawable="@drawable/rotate_progress"
        android:visibility="gone" />

    <ImageButton
        android:id="@+id/fastUpWall"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_alignParentTop="true"
        android:visibility="gone"
        android:src="@drawable/fast_up" />

    <ImageButton
        android:id="@+id/fastDownWall"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_alignParentBottom="true"
        android:visibility="gone"
        android:src="@drawable/fast_down" />

</RelativeLayout>

I dont think the error is in the section of RelativeLayout$LayoutParams because i get this error before the layout even created and even its RelativeLayout$LayoutParams problem i dont get any line number for the error so its really hard to track.

I guess its something with the style on low SDK.

Thank for helping.

dasdasd
  • 1,971
  • 10
  • 45
  • 72

1 Answers1

2

/This is because you are using theme attributes that were not present on the platform on which you are running your application. The newer attributes are never read on the older platforms. Use higher sdk version, or rid from attributes in you style that doesn't support in this sdk version./

UPD: Wait, probably, the problem is not in it. Look at this sector of code: 10-16 11:28:16.624: E/AndroidRuntime(427): java.lang.ClassCastException: android.widget.RelativeLayout$LayoutParams This mean that layout params have to be of the type of the parent. So if you are creating a RelativeLayout and adding it to a ListView, the layout params must be of type ListView.LayoutParams, not RelativeLayout.LayoutParams. Please put the code where you on this line.

macloving
  • 1,227
  • 1
  • 18
  • 22
  • I dont sure i understand you. some layouts do open for me and holoeverywhere should support sdk 8 – dasdasd Oct 16 '13 at 11:45
  • 2
    Wait, probably, the problem is not in it. Look at this sector of code: 10-16 11:28:16.624: E/AndroidRuntime(427): java.lang.ClassCastException: android.widget.RelativeLayout$LayoutParams This mean that layout params have to be of the type of the parent. So if you are creating a RelativeLayout and adding it to a ListView, the layout params must be of type ListView.LayoutParams, not RelativeLayout.LayoutParams. Please put the code where you on this line. – macloving Oct 16 '13 at 12:19
  • 1
    @macloving You should make your last comment an answer so it can be upvoted – Anderson Mar 29 '14 at 10:22