Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 1 of 1

Thread: Could someone help me with the Seekbar control, I'm getting errors..

  1. #1
    Junior Member
    Join Date
    Jul 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Could someone help me with the Seekbar control, I'm getting errors..

    Hi All,
    I have followed a tutorial on using graphics for the slider part of the seekbar, I can change the color using hex values and that works fine. But since I am having issues creating a hex code to get the green to blend into red, so I found a tutorial on using graphics with drawpatch9 and clips.
    Here is my logcat..
    07-22 15:08:16.142: E/AndroidRuntime(31331): FATAL EXCEPTION: main
    07-22 15:08:16.142: E/AndroidRuntime(31331): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.hsmtdemo/com.example.hsmtdemo.TESTMainActivity}: android.view.InflateException: Binary XML file line #12: Error inflating class android.widget.SeekBar
    07-22 15:08:16.142: E/AndroidRuntime(31331): at android.app.ActivityThread.performLaunchActivity(A ctivityThread.java:2110)
    07-22 15:08:16.142: E/AndroidRuntime(31331): at android.app.ActivityThread.handleLaunchActivity(Ac tivityThread.java:2135)
    07-22 15:08:16.142: E/AndroidRuntime(31331): at android.app.ActivityThread.access$700(ActivityThre ad.java:143)
    07-22 15:08:16.142: E/AndroidRuntime(31331): at android.app.ActivityThread$H.handleMessage(Activit yThread.java:1241)
    07-22 15:08:16.142: E/AndroidRuntime(31331): at android.os.Handler.dispatchMessage(Handler.java:99 )
    07-22 15:08:16.142: E/AndroidRuntime(31331): at android.os.Looper.loop(Looper.java:137)
    07-22 15:08:16.142: E/AndroidRuntime(31331): at android.app.ActivityThread.main(ActivityThread.jav a:4961)
    07-22 15:08:16.142: E/AndroidRuntime(31331): at java.lang.reflect.Method.invokeNative(Native Method)
    07-22 15:08:16.142: E/AndroidRuntime(31331): at java.lang.reflect.Method.invoke(Method.java:511)
    07-22 15:08:16.142: E/AndroidRuntime(31331): at com.android.internal.os.ZygoteInit$MethodAndArgsCa ller.run(ZygoteInit.java:1004)
    07-22 15:08:16.142: E/AndroidRuntime(31331): at com.android.internal.os.ZygoteInit.main(ZygoteInit .java:771)
    07-22 15:08:16.142: E/AndroidRuntime(31331): at dalvik.system.NativeStart.main(Native Method)
    07-22 15:08:16.142: E/AndroidRuntime(31331): Caused by: android.view.InflateException: Binary XML file line #12: Error inflating class android.widget.SeekBar
    07-22 15:08:16.142: E/AndroidRuntime(31331): at android.view.LayoutInflater.createView(LayoutInfla ter.java:613)
    07-22 15:08:16.142: E/AndroidRuntime(31331): at com.android.internal.policy.impl.PhoneLayoutInflat er.onCreateView(PhoneLayoutInflater.java:56)
    07-22 15:08:16.142: E/AndroidRuntime(31331): at android.view.LayoutInflater.onCreateView(LayoutInf later.java:660)
    07-22 15:08:16.142: E/AndroidRuntime(31331): at android.view.LayoutInflater.createViewFromTag(Layo utInflater.java:685)
    07-22 15:08:16.142: E/AndroidRuntime(31331): at android.view.LayoutInflater.rInflate(LayoutInflate r.java:746)
    07-22 15:08:16.142: E/AndroidRuntime(31331): at android.view.LayoutInflater.inflate(LayoutInflater .java:489)
    07-22 15:08:16.142: E/AndroidRuntime(31331): at android.view.LayoutInflater.inflate(LayoutInflater .java:396)
    07-22 15:08:16.142: E/AndroidRuntime(31331): at android.view.LayoutInflater.inflate(LayoutInflater .java:352)
    07-22 15:08:16.142: E/AndroidRuntime(31331): at com.android.internal.policy.impl.PhoneWindow.setCo ntentView(PhoneWindow.java:309)
    07-22 15:08:16.142: E/AndroidRuntime(31331): at android.app.Activity.setContentView(Activity.java: 1914)
    07-22 15:08:16.142: E/AndroidRuntime(31331): at com.example.hsmtdemo.TESTMainActivity.onCreate(TES TMainActivity.java:14)
    07-22 15:08:16.142: E/AndroidRuntime(31331): at android.app.Activity.performCreate(Activity.java:5 179)
    07-22 15:08:16.142: E/AndroidRuntime(31331): at android.app.Instrumentation.callActivityOnCreate(I nstrumentation.java:1094)
    07-22 15:08:16.142: E/AndroidRuntime(31331): at android.app.ActivityThread.performLaunchActivity(A ctivityThread.java:2074)
    07-22 15:08:16.142: E/AndroidRuntime(31331): ... 11 more
    07-22 15:08:16.142: E/AndroidRuntime(31331): Caused by: java.lang.reflect.InvocationTargetException
    07-22 15:08:16.142: E/AndroidRuntime(31331): at java.lang.reflect.Constructor.constructNative(Nati ve Method)
    07-22 15:08:16.142: E/AndroidRuntime(31331): at java.lang.reflect.Constructor.newInstance(Construc tor.java:417)
    07-22 15:08:16.142: E/AndroidRuntime(31331): at android.view.LayoutInflater.createView(LayoutInfla ter.java:587)
    07-22 15:08:16.142: E/AndroidRuntime(31331): ... 24 more
    07-22 15:08:16.142: E/AndroidRuntime(31331): Caused by: android.content.res.Resources$NotFoundException: File res/xml/progbg.xml from drawable resource ID #0x7f040000
    07-22 15:08:16.142: E/AndroidRuntime(31331): at android.content.res.Resources.loadDrawable(Resourc es.java:1951)
    07-22 15:08:16.142: E/AndroidRuntime(31331): at android.content.res.TypedArray.getDrawable(TypedAr ray.java:601)
    07-22 15:08:16.142: E/AndroidRuntime(31331): at android.widget.ProgressBar.<init>(ProgressBar.java :263)
    07-22 15:08:16.142: E/AndroidRuntime(31331): at android.widget.ProgressBar.<init>(ProgressBar.java :247)
    07-22 15:08:16.142: E/AndroidRuntime(31331): at android.widget.AbsSeekBar.<init>(AbsSeekBar.java:7 6)
    07-22 15:08:16.142: E/AndroidRuntime(31331): at android.widget.SeekBar.<init>(SeekBar.java:83)
    07-22 15:08:16.142: E/AndroidRuntime(31331): at android.widget.SeekBar.<init>(SeekBar.java:79)
    07-22 15:08:16.142: E/AndroidRuntime(31331): ... 27 more
    07-22 15:08:16.142: E/AndroidRuntime(31331): Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #18: <bitmap> requires a valid src attribute
    07-22 15:08:16.142: E/AndroidRuntime(31331): at android.graphics.drawable.BitmapDrawable.inflate(B itmapDrawable.java:448)
    07-22 15:08:16.142: E/AndroidRuntime(31331): at android.graphics.drawable.Drawable.createFromXmlIn ner(Drawable.java:881)
    07-22 15:08:16.142: E/AndroidRuntime(31331): at android.graphics.drawable.ClipDrawable.inflate(Cli pDrawable.java:97)
    07-22 15:08:16.142: E/AndroidRuntime(31331): at android.graphics.drawable.Drawable.createFromXmlIn ner(Drawable.java:881)
    07-22 15:08:16.142: E/AndroidRuntime(31331): at android.graphics.drawable.LayerDrawable.inflate(La yerDrawable.java:165)
    07-22 15:08:16.142: E/AndroidRuntime(31331): at android.graphics.drawable.Drawable.createFromXmlIn ner(Drawable.java:881)
    07-22 15:08:16.142: E/AndroidRuntime(31331): at android.graphics.drawable.Drawable.createFromXml(D rawable.java:818)
    07-22 15:08:16.142: E/AndroidRuntime(31331): at android.content.res.Resources.loadDrawable(Resourc es.java:1948)
    07-22 15:08:16.142: E/AndroidRuntime(31331): ... 33 more


    in short the logcat has told me that it can't parse the xml file and something about it not being able to inflate the seekbar widget....any idea's on whats going wrong..
    I had revised the code to reflect my apps needs. The code is attached because i'm having issues posting the code here.

    Thanks
    Attached Files Attached Files


Similar Threads

  1. timer control
    By amber_hell in forum What's Wrong With My Code?
    Replies: 1
    Last Post: February 26th, 2013, 06:16 AM
  2. Printer control
    By bardd in forum Java Theory & Questions
    Replies: 4
    Last Post: August 31st, 2012, 08:15 AM
  3. Replies: 3
    Last Post: March 6th, 2012, 02:50 AM
  4. [SOLVED] DoublyLinkedList out of control!
    By javapenguin in forum What's Wrong With My Code?
    Replies: 3
    Last Post: October 13th, 2010, 07:06 AM
  5. process control
    By ttsdinesh in forum Java Native Interface
    Replies: 6
    Last Post: October 27th, 2009, 06:29 PM

Tags for this Thread