Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9016419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:59:29+00:00 2026-06-16T03:59:29+00:00

I have created extension of the SeekBar class: package com.simplemathgame; import android.content.Context; import android.widget.SeekBar;

  • 0

I have created extension of the SeekBar class:

package com.simplemathgame;

import android.content.Context;
import android.widget.SeekBar;
import android.widget.TextView;

public class SeekBarPlus extends SeekBar {
    private TextView numberOfDrills;

    public SeekBarPlus(Context context) {
        super(context);
        // TODO Auto-generated constructor stub
    }

    public void onStartTrackingTouch(SeekBar seekBar) {
        // TODO Auto-generated method stub

    }

    public void onStopTrackingTouch(SeekBar seekBar) {
        // TODO Auto-generated method stub

    }

    public void onProgressChanged(SeekBar seekBar, int progress,
            boolean fromUser) {
        // TODO Auto-generated method stub
        numberOfDrills.setText(progress); 
    }

    public void setTextView(TextView textView){
        numberOfDrills = textView;
    }

}

and here is the xml layout file:

<?xml version="1.0" encoding="utf-8"?>
<TableLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_height="fill_parent" 
    android:layout_width="fill_parent"
    android:background="#000044">
    <TableRow 
        android:layout_marginTop="10dp"
        android:gravity="center_vertical" >
        <TextView 
            android:textColor="#FFFFFFFF"
            android:textSize="16sp"
            android:textStyle="bold"
            android:text="Addition Drills:"/>
    </TableRow>
    <TableRow
        android:layout_marginTop="5dp"
         android:gravity="center_vertical" >

        <com.simplemathgame.SeekBarPlus
            android:id="@+id/add_seek_bar"
            android:layout_width="20dp"
            android:max="10" 
            android:layout_weight="0.8"/>
        <TextView 
            android:id="@+id/add_drills_number" 
            android:textColor="#FFFFFFFF"
            android:textSize="16sp"
            android:textStyle="bold"
            android:layout_weight="0.2"
            android:gravity="center_horizontal"
            android:text="0"/>
    </TableRow>
</TableLayout>

Here is the logCat:

12-19 19:52:48.457: D/dalvikvm(335): GC_EXTERNAL_ALLOC freed 46K, 53% free 2546K/5379K, external 1917K/2137K, paused 72ms
12-19 19:52:51.617: D/AndroidRuntime(335): Shutting down VM
12-19 19:52:51.617: W/dalvikvm(335): threadid=1: thread exiting with uncaught exception (group=0x40015560)
12-19 19:52:51.647: E/AndroidRuntime(335): FATAL EXCEPTION: main
12-19 19:52:51.647: E/AndroidRuntime(335): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.simplemathgame/com.simplemathgame.MainActivity}: android.view.InflateException: Binary XML file line #20: Error inflating class com.simplemathgame.SeekBarPlus
12-19 19:52:51.647: E/AndroidRuntime(335):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
12-19 19:52:51.647: E/AndroidRuntime(335):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
12-19 19:52:51.647: E/AndroidRuntime(335):  at android.app.ActivityThread.access$1500(ActivityThread.java:117)
12-19 19:52:51.647: E/AndroidRuntime(335):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
12-19 19:52:51.647: E/AndroidRuntime(335):  at android.os.Handler.dispatchMessage(Handler.java:99)
12-19 19:52:51.647: E/AndroidRuntime(335):  at android.os.Looper.loop(Looper.java:123)
12-19 19:52:51.647: E/AndroidRuntime(335):  at android.app.ActivityThread.main(ActivityThread.java:3683)
12-19 19:52:51.647: E/AndroidRuntime(335):  at java.lang.reflect.Method.invokeNative(Native Method)
12-19 19:52:51.647: E/AndroidRuntime(335):  at java.lang.reflect.Method.invoke(Method.java:507)
12-19 19:52:51.647: E/AndroidRuntime(335):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
12-19 19:52:51.647: E/AndroidRuntime(335):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
12-19 19:52:51.647: E/AndroidRuntime(335):  at dalvik.system.NativeStart.main(Native Method)
12-19 19:52:51.647: E/AndroidRuntime(335): Caused by: android.view.InflateException: Binary XML file line #20: Error inflating class com.simplemathgame.SeekBarPlus
12-19 19:52:51.647: E/AndroidRuntime(335):  at android.view.LayoutInflater.createView(LayoutInflater.java:508)
12-19 19:52:51.647: E/AndroidRuntime(335):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:570)
12-19 19:52:51.647: E/AndroidRuntime(335):  at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
12-19 19:52:51.647: E/AndroidRuntime(335):  at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
12-19 19:52:51.647: E/AndroidRuntime(335):  at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
12-19 19:52:51.647: E/AndroidRuntime(335):  at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
12-19 19:52:51.647: E/AndroidRuntime(335):  at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
12-19 19:52:51.647: E/AndroidRuntime(335):  at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:207)
12-19 19:52:51.647: E/AndroidRuntime(335):  at android.app.Activity.setContentView(Activity.java:1657)
12-19 19:52:51.647: E/AndroidRuntime(335):  at com.simplemathgame.MainActivity.onCreate(MainActivity.java:16)
12-19 19:52:51.647: E/AndroidRuntime(335):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
12-19 19:52:51.647: E/AndroidRuntime(335):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
12-19 19:52:51.647: E/AndroidRuntime(335):  ... 11 more
12-19 19:52:51.647: E/AndroidRuntime(335): Caused by: java.lang.NoSuchMethodException: SeekBarPlus(Context,AttributeSet)
12-19 19:52:51.647: E/AndroidRuntime(335):  at java.lang.Class.getMatchingConstructor(Class.java:643)
12-19 19:52:51.647: E/AndroidRuntime(335):  at java.lang.Class.getConstructor(Class.java:472)
12-19 19:52:51.647: E/AndroidRuntime(335):  at android.view.LayoutInflater.createView(LayoutInflater.java:480)
12-19 19:52:51.647: E/AndroidRuntime(335):  ... 22 more

I see there is a problem with the extended SeekBarPlus class, But don’t really know why. Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T03:59:30+00:00Added an answer on June 16, 2026 at 3:59 am

    You haven’t specified full set of constructors in your custom view class. In your particular case, SeekBarPlus(Context,AttributeSet) constructor is missing.

    Custom view class needs to have these 3 constructors:

    public SeekBarPlus(Context context) {
        super(context);
    }
    
    public SeekBarPlus(Context context, AttributeSet attrs) {
        super(context, attrs);
    }
    
    public SeekBarPlus(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }
    

    If you don’t need them, just call super() as shown above.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created my own extension as: public static MvcHtmlString hSearch(this HtmlHelper helper, string
I have created an extension method as such.. public static bool AllFlagsSet<T>(this T input,
I have created a Extension method for IQueryable class to convert list of a
I have created an extension method called AddGZip which looks like the following: public
I have created an extension method for an ASP.NET MVC ViewPage, e.g: public static
I have created a Shell Extension using ATL COM Object . But during creation
I have created the app with forge, and have added in the chrome extension,
i have installed SharePoint 2007 and VS2008 extension on my computer.i have created a
I have an app that recognizes an extension of a file created in my
In my extension, I have a content script that creates a <div> containing an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.