Indicator color changing method not working.
See original GitHub issueIn my activity, getting error on this line.
mController.setSelectedIndicatorColor(R.color.colorPrimary);
Error Log:
FATAL EXCEPTION: main
Process: user.com.smartwashr, PID: 26838
java.lang.RuntimeException: Unable to start activity ComponentInfo{user.com.smartwashr/user.com.smartwashr.activities.HowToActivity}: java.lang.NullPointerException: Attempt to invoke interface method 'void com.github.paolorotolo.appintro.IndicatorController.setSelectedIndicatorColor(int)' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2572)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2654)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1488)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:5728)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)
Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'void com.github.paolorotolo.appintro.IndicatorController.setSelectedIndicatorColor(int)' on a null object reference
at user.com.smartwashr.activities.HowToActivity.onCreate(HowToActivity.java:54)
at android.app.Activity.performCreate(Activity.java:6309)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1113)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2519)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2654)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1488)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:5728)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Indicator color changing method not working. #445 - GitHub
In my activity, getting error on this line. mController.setSelectedIndicatorColor(R.color.colorPrimary); Error Log: FATAL EXCEPTION: main ...
Read more >How to change the new TabLayout indicator color and height
TabLayout , and found a problem, in the class definition, there are no methods to change the indicator color, and default height.
Read more >pH and Color Change | Chapter 6 - Middle School Chemistry
Students will see a demonstration of a color change using universal pH indicator. Students will change the concentrations of an acid and a...
Read more >Colour Change - Titration Indicators - YouTube
Colour Change - Titration Indicators. 5.5K views 1 year ago ... Solving Acid-Base Titration Problems ... Titration procedure (Step by step).
Read more >RE: Problem with Changing the string indicator's text and color
I have a state machine with idle > test > report > idle flow. I need to set the front panel string as...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you @paolorotolo for answer, @Almaral-Engineering try this , it helped me
setIndicatorColor(getResources.getColor(R.id.blue), getResources.getColor(R.id.red));
setIndicatorColor(getResources().getColor(R.color.black),getResources().getColor(R.color.md_blue_grey_600;