Note that there are some explanatory texts on larger screens.

plurals
  1. POProgress Bar in android
    primarykey
    data
    text
    <p>I have tried to implement the ProgressBar in my application that gets displayed when I click on the Button which plays the sound.</p> <p>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.</p> <pre><code>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); } }); </code></pre> <p>The Logcat OutPut is :</p> <pre><code>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 </code></pre> <p>Can any body please help me?</p> <p>Thanks, david,</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload