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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T09:13:04+00:00 2026-05-18T09:13:04+00:00

I have tried to implement the ProgressBar in my application that gets displayed when

  • 0

I have tried to implement the ProgressBar in my application that gets displayed when I click on the Button which plays the sound.

I have done the coding but I get the run time exception and the application is not starting.
Here I am posting my code for the reference.

holder.imgPlaybtn.setOnClickListener(new View.OnClickListener() 
            {

                public void onClick(View v) 
                {
                    ProgressDialog progressDialog;
                    OnClickListener myContext = this;
                    progressDialog = new ProgressDialog((Context) myContext);
                    progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
                    progressDialog.setMessage("...");
                    progressDialog.setCancelable(false);

                }
            });

The Logcat OutPut is :

12-02 12:19:58.268: ERROR/AndroidRuntime(392): java.lang.ClassCastException: com.android.soundmachine.Switch2DataList$SoundMacHineAdapter$2
12-02 12:19:58.268: ERROR/AndroidRuntime(392):     at com.android.soundmachine.Switch2DataList$SoundMacHineAdapter$2.onClick(Switch2DataList.java:1645)
12-02 12:19:58.268: ERROR/AndroidRuntime(392):     at android.view.View.performClick(View.java:2364)
12-02 12:19:58.268: ERROR/AndroidRuntime(392):     at android.view.View.onTouchEvent(View.java:4179)
12-02 12:19:58.268: ERROR/AndroidRuntime(392):     at android.view.View.dispatchTouchEvent(View.java:3709)
12-02 12:19:58.268: ERROR/AndroidRuntime(392):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
12-02 12:19:58.268: ERROR/AndroidRuntime(392):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
12-02 12:19:58.268: ERROR/AndroidRuntime(392):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
12-02 12:19:58.268: ERROR/AndroidRuntime(392):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
12-02 12:19:58.268: ERROR/AndroidRuntime(392):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
12-02 12:19:58.268: ERROR/AndroidRuntime(392):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
12-02 12:19:58.268: ERROR/AndroidRuntime(392):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
12-02 12:19:58.268: ERROR/AndroidRuntime(392):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)
12-02 12:19:58.268: ERROR/AndroidRuntime(392):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)
12-02 12:19:58.268: ERROR/AndroidRuntime(392):     at android.app.Activity.dispatchTouchEvent(Activity.java:2061)
12-02 12:19:58.268: ERROR/AndroidRuntime(392):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)
12-02 12:19:58.268: ERROR/AndroidRuntime(392):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1691)
12-02 12:19:58.268: ERROR/AndroidRuntime(392):     at android.os.Handler.dispatchMessage(Handler.java:99)
12-02 12:19:58.268: ERROR/AndroidRuntime(392):     at android.os.Looper.loop(Looper.java:123)
12-02 12:19:58.268: ERROR/AndroidRuntime(392):     at android.app.ActivityThread.main(ActivityThread.java:4363)
12-02 12:19:58.268: ERROR/AndroidRuntime(392):     at java.lang.reflect.Method.invokeNative(Native Method)
12-02 12:19:58.268: ERROR/AndroidRuntime(392):     at java.lang.reflect.Method.invoke(Method.java:521)
12-02 12:19:58.268: ERROR/AndroidRuntime(392):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
12-02 12:19:58.268: ERROR/AndroidRuntime(392):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
12-02 12:19:58.268: ERROR/AndroidRuntime(392):     at dalvik.system.NativeStart.main(Native Method)
12-02 12:19:58.287: INFO/Process(52): Sending signal. PID: 392 SIG: 3
12-02 12:19:58.287: INFO/dalvikvm(392): threadid=7: reacting to signal 3
12-02 12:19:58.287: ERROR/dalvikvm(392): Unable to open stack trace file '/data/anr/traces.txt': Permission denied
12-02 12:20:05.098: DEBUG/dalvikvm(99): GC freed 2375 objects / 139384 bytes in 81ms
12-02 12:20:10.077: DEBUG/dalvikvm(212): GC freed 43 objects / 2096 bytes in 58ms

Can any body please help me?

Thanks,
david,

  • 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-05-18T09:13:05+00:00Added an answer on May 18, 2026 at 9:13 am

    progressDialog = new ProgressDialog((Context) myContext);
    This is wrong, you can use instead of it:

     progressDialog = new ProgressDialog(v.getContext());
    

    And also, you forgot to call the show() method to show the progressbar dialog box, write the below line at the end:

    progressDialog.show();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have tried what seems like everything - I've done similiar things many times
i have tried implement two methods recursive and dynamic method and both took 0
I have tried to implement progress reporting using a soap extension as described at
I have tried to implement this jQuery active menu code: http://docs.jquery.com/Tutorials:Auto-Selecting_Navigation $(function(){ var path
I have tried to implement binary insertion sort algorithm. Here is my code: public
I have tried to implement the puts function.It in actual returns a value but
i have tried to implement following code #include <iostream> #include <bitset> using namespace std;
I have tried to implement doubly linked list in C++. Here is the code,
I have tried to implement Stack Overflow question C++ Data Member Alignment and Array Packing
I have tried to implement a program using sockets in Ubuntu 10.04. Here is

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.