IndicatorSeekBar icon indicating copy to clipboard operation
IndicatorSeekBar copied to clipboard

Update Tick Count Programatically

Open raghavsatyadev opened this issue 6 years ago • 4 comments

Reference Issue : #81

Seekbar generated from XML does not accept tick count programatically.

There is a method present IndicatorSeekBar#setTickCount( count ) , but it crashes the application.

raghavsatyadev avatar Jan 09 '19 14:01 raghavsatyadev

@raghavsatyadev any crash log can you provide?

warkiz avatar Jan 10 '19 03:01 warkiz

I tested the code again after firstly setting tick count to XML and then programatically changing it from Java, it worked. And to provide you the crash report I removed initial tick count property from the XML and only set it through Java.

Process: com.appdroidtechno.videodpcreator, PID: 4185
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.appdroidtechno.videodpcreator/com.appdroidtechno.videodpcreator.ui.VideoDetailActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.text.TextPaint.getTextBounds(java.lang.String, int, int, android.graphics.Rect)' on a null object reference
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2861)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2943)
        at android.app.ActivityThread.-wrap11(Unknown Source:0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1630)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6626)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:811)
     Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.text.TextPaint.getTextBounds(java.lang.String, int, int, android.graphics.Rect)' on a null object reference
        at com.warkiz.widget.IndicatorSeekBar.initTextsArray(IndicatorSeekBar.java:405)
        at com.warkiz.widget.IndicatorSeekBar.setTickCount(IndicatorSeekBar.java:1977)
        at com.appdroidtechno.videodpcreator.ui.VideoDetailActivity.setDetails(VideoDetailActivity.java:90)
        at com.appdroidtechno.videodpcreator.ui.VideoDetailActivity.onCreate(VideoDetailActivity.java:77)
        at android.app.Activity.performCreate(Activity.java:7032)
        at android.app.Activity.performCreate(Activity.java:7023)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1236)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2814)

raghavsatyadev avatar Jan 10 '19 09:01 raghavsatyadev

Sorry issue was mistakenly closed

raghavsatyadev avatar Jan 10 '19 09:01 raghavsatyadev

Hi @warkiz , any update on this issue? I'm still facing this issue.

hchouhan02 avatar Feb 08 '20 15:02 hchouhan02