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 8130347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T08:40:39+00:00 2026-06-06T08:40:39+00:00

I need my app to create a dialog Seekbar. But I cannot make it

  • 0

I need my app to create a dialog Seekbar. But I cannot make it work. I referring this stackoverflow question Android, SeekBar in dialog and here is my code.

I am creating a menu, and on menu item when user clicks size_config button it should show seekbar.

 }if(item.getItemId() == R.id.size_config){
        LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        View layout = inflater.inflate(R.id.dialog, (ViewGroup)findViewById(R.id.layout));
        AlertDialog.Builder builder = new AlertDialog.Builder(this)
        .setView(layout);
        AlertDialog alertDialog = builder.create();
        alertDialog.show();
        SeekBar sb = (SeekBar)layout.findViewById(R.id.dialog);
        sb.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
            public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser){
                Log.d("Dialog to change size", "It's working");
            }

            @Override
            public void onStartTrackingTouch(SeekBar arg0) {
                // TODO Auto-generated method stub

            }

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

            }
        });
    }

And this is the layout file.

dialog.xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
   android:orientation="vertical"
   android:layout_width="wrap_content"
   android:layout_height="wrap_content"
   android:padding="10dp"
   android:id="@+id/layout">

<SeekBar xmlns:android="http://schemas.android.com/apk/res/android"
   android:id="@+id/dialog"
   android:layout_width="225dp"
   android:layout_height="wrap_content"/>

</LinearLayout>

Here is the error code.

 06-24 02:31:30.369: E/AndroidRuntime(379): FATAL EXCEPTION: main
 06-24 02:31:30.369: E/AndroidRuntime(379): android.content.res.Resources$NotFoundException: Resource ID #0x7f070001 type #0x12 is not valid
 06-24 02:31:30.369: E/AndroidRuntime(379):     at android.content.res.Resources.loadXmlResourceParser(Resources.java:1874)
 06-24 02:31:30.369: E/AndroidRuntime(379):     at android.content.res.Resources.getLayout(Resources.java:731)
 06-24 02:31:30.369: E/AndroidRuntime(379):     at android.view.LayoutInflater.inflate(LayoutInflater.java:318)
 06-24 02:31:30.369: E/AndroidRuntime(379):     at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
 06-24 02:31:30.369: E/AndroidRuntime(379):     at in.isuru.animation.SnowFall.onOptionsItemSelected(SnowFall.java:189)
 06-24 02:31:30.369: E/AndroidRuntime(379):     at android.app.Activity.onMenuItemSelected(Activity.java:2195)
 06-24 02:31:30.369: E/AndroidRuntime(379):     at com.android.internal.policy.impl.PhoneWindow.onMenuItemSelected(PhoneWindow.java:730)
 06-24 02:31:30.369: E/AndroidRuntime(379):     at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:143)
 06-24 02:31:30.369: E/AndroidRuntime(379):     at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:855)
 06-24 02:31:30.369: E/AndroidRuntime(379):     at com.android.internal.view.menu.MenuDialogHelper.onClick(MenuDialogHelper.java:137)
 06-24 02:31:30.369: E/AndroidRuntime(379):     at com.android.internal.app.AlertController$AlertParams$3.onItemClick(AlertController.java:874)
 06-24 02:31:30.369: E/AndroidRuntime(379):     at android.widget.AdapterView.performItemClick(AdapterView.java:284)
 06-24 02:31:30.369: E/AndroidRuntime(379):     at android.widget.ListView.performItemClick(ListView.java:3382)
 06-24 02:31:30.369: E/AndroidRuntime(379):     at android.widget.AbsListView$PerformClick.run(AbsListView.java:1696)
 06-24 02:31:30.369: E/AndroidRuntime(379):     at  android.os.Handler.handleCallback(Handler.java:587)
 06-24 02:31:30.369: E/AndroidRuntime(379):     at android.os.Handler.dispatchMessage(Handler.java:92)
 06-24 02:31:30.369: E/AndroidRuntime(379):     at android.os.Looper.loop(Looper.java:123)
 06-24 02:31:30.369: E/AndroidRuntime(379):     at android.app.ActivityThread.main(ActivityThread.java:4627)
 06-24 02:31:30.369: E/AndroidRuntime(379):     at java.lang.reflect.Method.invokeNative(Native Method)
 06-24 02:31:30.369: E/AndroidRuntime(379):     at java.lang.reflect.Method.invoke(Method.java:521)
 06-24 02:31:30.369: E/AndroidRuntime(379):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
 06-24 02:31:30.369: E/AndroidRuntime(379):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
 06-24 02:31:30.369: E/AndroidRuntime(379):     at dalvik.system.NativeStart.main(Native Method)
  • 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-06T08:40:42+00:00Added an answer on June 6, 2026 at 8:40 am

    Here is how to add SeekBar dialog,

    Dialog dialog = new Dialog(this);
    dialog.setContentView(R.layout.dialog);
    dialog.setTitle("Set size!");
    dialog.setCancelable(true);
    //there are a lot of settings, for dialog, check them all out!
    dialog.show();
    
    seekbar = (SeekBar) dialog.findViewById(R.id.size_seekbar);
    final TextView tv_dialog_size = (TextView) dialog.findViewById(R.id.set_size_help_text);
    
    // and you can call seekbar.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {
          //implement methods.
    }
    

    And dialog layout xml is,

     <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
         android:id="@+id/layout"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:orientation="vertical"
         android:padding="2dp"
         android:layout_gravity="center" >
    
    <TextView
        android:id="@+id/set_size_help_text"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
    
        android:text="Please select snowflake size"
        android:textSize="25dp" />
    
    <SeekBar
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/size_seekbar"
        android:layout_width="250dp"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dp" />
    
    </LinearLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

All, I need to create an app for work that signs into our website
I need to develop an android app that achieves the following: Create an activity
I need to create a compass on an app i am working on. So
I need to create a web app for a client, and one of the
In my app, I create view controller objects as I need them. When a
I am building a web app using Codeigniter 2.0.3. I need to create base
I'm maintaining this Swing app that has a print option. Users need to be
After reading some posts like this one: Choose File Dialog It appears that Android
I have created app using jQuery Mobile and need to get a Dialog box
I need to create app that supports Swedish and English languages. Please help me

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.