Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting Null pointer exception #56

Open
PreetiW opened this issue Mar 20, 2015 · 4 comments
Open

Getting Null pointer exception #56

PreetiW opened this issue Mar 20, 2015 · 4 comments

Comments

@PreetiW
Copy link

PreetiW commented Mar 20, 2015

Failed to find style 'asb_switchStyle' in current theme
java.lang.NullPointerException
Exception details are logged in Window > Show View > Error Log

java.lang.NullPointerException
at android.text.Layout.getDesiredWidth(Layout.java:68)
at org.jraf.android.backport.switchwidget.Switch.makeLayout(Switch.java:350)
at org.jraf.android.backport.switchwidget.Switch.onMeasure(Switch.java:302)
at android.view.View.measure(View.java:17430)
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:727)
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:463)
at android.view.View.measure(View.java:17430)
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:727)
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:463)
at android.view.View.measure(View.java:17430)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5463)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:430)
at android.view.View.measure(View.java:17430)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:875)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:613)
at android.view.View.measure(View.java:17430)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:875)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:613)
at android.view.View.measure(View.java:17430)

I added the style as described as follows :

<style name="AppTheme" parent="@android:style/Theme"> true false false @null @style/Widget.Holo.CompoundButton.Switch </style>

stil i ma getting the error . I am assuming i am not describing the style properly can you please help.

@BoD
Copy link
Owner

BoD commented Mar 20, 2015

You defined the style, but are you actually using the theme?

@PreetiW
Copy link
Author

PreetiW commented Mar 22, 2015

I didnt get you.. can you elaborate please?

@BoD
Copy link
Owner

BoD commented Mar 22, 2015

You have defined a theme with the above attributes.
But you also have to use the theme in your application or activity - did you do it?

@PreetiW
Copy link
Author

PreetiW commented Mar 22, 2015

yes i've defined the above in my manifest file

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

No branches or pull requests

2 participants