Skip to content
This repository has been archived by the owner on Jan 12, 2018. It is now read-only.

It crash when using when using in my project as follow. #2

Open
arslan-anwar opened this issue Feb 28, 2013 · 4 comments
Open

It crash when using when using in my project as follow. #2

arslan-anwar opened this issue Feb 28, 2013 · 4 comments

Comments

@arslan-anwar
Copy link

I have added the project in library and add in XML in such a way
xmlns:app="http://schemas.android.com/apk/res/my.project.package"
<de.ankri.views.Switch
android:id="@+id/ui_edit_group_camera_row_switch"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginTop="20dp"
android:paddingLeft="20dp"
android:paddingRight="20dp"
app:textOff="Left"
app:textOn="Right" />

It crash with this report.

02-28 23:51:59.574: W/dalvikvm(733): threadid=1: thread exiting with uncaught exception (group=0x40e60300)
02-28 23:51:59.691: E/AndroidRuntime(733): FATAL EXCEPTION: main
02-28 23:51:59.691: E/AndroidRuntime(733): java.lang.NullPointerException
02-28 23:51:59.691: E/AndroidRuntime(733): at de.ankri.views.Switch.onMeasure(Switch.java:508)
02-28 23:51:59.691: E/AndroidRuntime(733): at android.view.View.measure(View.java:15172)
02-28 23:51:59.691: E/AndroidRuntime(733): at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:617)
02-28 23:51:59.691: E/AndroidRuntime(733): at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:399)
02-28 23:51:59.691: E/AndroidRuntime(733): at android.view.View.measure(View.java:15172)
02-28 23:51:59.691: E/AndroidRuntime(733): at android.widget.ListView.measureScrapChild(ListView.java:1181)
02-28 23:51:59.691: E/AndroidRuntime(733): at android.widget.ListView.measureHeightOfChildren(ListView.java:1246)
02-28 23:51:59.691: E/AndroidRuntime(733): at android.widget.ListView.onMeasure(ListView.java:1156)
02-28 23:51:59.691: E/AndroidRuntime(733): at android.view.View.measure(View.java:15172)
02-28 23:51:59.691: E/AndroidRuntime(733): at android.widget.RelativeLayout.measureChild(RelativeLayout.java:602)
02-28 23:51:59.691: E/AndroidRuntime(733): at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:415)
02-28 23:51:59.691: E/AndroidRuntime(733): at android.view.View.measure(View.java:15172)
02-28 23:51:59.691: E/AndroidRuntime(733): at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:617)
02-28 23:51:59.691: E/AndroidRuntime(733): at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:399)
02-28 23:51:59.691: E/AndroidRuntime(733): at android.view.View.measure(View.java:15172)
02-28 23:51:59.691: E/AndroidRuntime(733): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4814)
02-28 23:51:59.691: E/AndroidRuntime(733): at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
02-28 23:51:59.691: E/AndroidRuntime(733): at android.view.View.measure(View.java:15172)
02-28 23:51:59.691: E/AndroidRuntime(733): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4814)
02-28 23:51:59.691: E/AndroidRuntime(733): at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1390)
02-28 23:51:59.691: E/AndroidRuntime(733): at android.widget.LinearLayout.measureVertical(LinearLayout.java:681)
02-28 23:51:59.691: E/AndroidRuntime(733): at android.widget.LinearLayout.onMeasure(LinearLayout.java:574)
02-28 23:51:59.691: E/AndroidRuntime(733): at android.view.View.measure(View.java:15172)
02-28 23:51:59.691: E/AndroidRuntime(733): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4814)
02-28 23:51:59.691: E/AndroidRuntime(733): at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
02-28 23:51:59.691: E/AndroidRuntime(733): at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2148)
02-28 23:51:59.691: E/AndroidRuntime(733): at android.view.View.measure(View.java:15172)
02-28 23:51:59.691: E/AndroidRuntime(733): at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:1848)
02-28 23:51:59.691: E/AndroidRuntime(733): at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1100)
02-28 23:51:59.691: E/AndroidRuntime(733): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1273)
02-28 23:51:59.691: E/AndroidRuntime(733): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:998)
02-28 23:51:59.691: E/AndroidRuntime(733): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4212)
02-28 23:51:59.691: E/AndroidRuntime(733): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
02-28 23:51:59.691: E/AndroidRuntime(733): at android.view.Choreographer.doCallbacks(Choreographer.java:555)
02-28 23:51:59.691: E/AndroidRuntime(733): at android.view.Choreographer.doFrame(Choreographer.java:525)
02-28 23:51:59.691: E/AndroidRuntime(733): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
02-28 23:51:59.691: E/AndroidRuntime(733): at android.os.Handler.handleCallback(Handler.java:615)
02-28 23:51:59.691: E/AndroidRuntime(733): at android.os.Handler.dispatchMessage(Handler.java:92)
02-28 23:51:59.691: E/AndroidRuntime(733): at android.os.Looper.loop(Looper.java:137)
02-28 23:51:59.691: E/AndroidRuntime(733): at android.app.ActivityThread.main(ActivityThread.java:4745)
02-28 23:51:59.691: E/AndroidRuntime(733): at java.lang.reflect.Method.invokeNative(Native Method)
02-28 23:51:59.691: E/AndroidRuntime(733): at java.lang.reflect.Method.invoke(Method.java:511)
02-28 23:51:59.691: E/AndroidRuntime(733): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
02-28 23:51:59.691: E/AndroidRuntime(733): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
02-28 23:51:59.691: E/AndroidRuntime(733): at dalvik.system.NativeStart.main(Native Method)

@euvid
Copy link

euvid commented Mar 31, 2013

I have the same issue. did you found a solution?

@icastell
Copy link

I have the same issue. In trying it with ActionBarSherlock

@icastell
Copy link

OK. I fixed it. In my onCreate method before to call super.onCreate a set the theme to the AppThemeLight, as I show below:

@Override
protected void onCreate(Bundle savedInstanceState) {

    setTheme(R.style.AppThemeLight);

    super.onCreate(savedInstanceState);
}

@joschplusa
Copy link

I had this issue too but just removed my comment as I found my mistake. I used the Actionbarsherlock Theme and added the values for TextAppearence and Slider to my custom theme but forgot to add it to the theme in my values-v11 folder... Maybe you all check your configuration too.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants