SimpleCropView icon indicating copy to clipboard operation
SimpleCropView copied to clipboard

java.util.concurrent.RejectedExecutionException:

Open TopTime1 opened this issue 6 years ago • 9 comments

java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.FutureTask@4f4343f rejected from java.util.concurrent.ThreadPoolExecutor@b9fa10c[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 4] at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2014) at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:794) at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1340) at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:82) at java.util.concurrent.Executors$DelegatedExecutorService.submit(Executors.java:594) at com.isseiaoki.simplecropview.CropImageView.saveAsync(CropImageView.java:1828) at com.isseiaoki.simplecropview.SaveRequest.execute(SaveRequest.java:41) at com.ikongjian.activity.CutActivity$2.onSuccess(CutActivity.java:173) at com.isseiaoki.simplecropview.CropImageView$10$1.run(CropImageView.java:1763) at android.os.Handler.handleCallback(Handler.java:743) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:150) at android.app.ActivityThread.main(ActivityThread.java:5621) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:684)

TopTime1 avatar Mar 22 '18 03:03 TopTime1

I too got same exception in save callback method

TaraAndroid avatar Mar 23 '18 11:03 TaraAndroid

I solve by limiting the number of Click Save, its internal thread pool is a single line pool

TopTime1 avatar Mar 26 '18 06:03 TopTime1

will u plz let me know what to do and where to do? bcz i m new to this library and have deadline. some times getting exceptions and some times no exception at all.

TaraAndroid avatar Mar 28 '18 04:03 TaraAndroid

@TopTime1 Can you share the solution?

fevziomurtekin avatar Oct 23 '18 23:10 fevziomurtekin

Click the save post gray button to prevent multiple clicks.

TopTime1 avatar Oct 24 '18 02:10 TopTime1

What's post gray button?

fevziomurtekin avatar Oct 24 '18 05:10 fevziomurtekin

button.setEnabled(false);save completion and then set it to true.

TopTime1 avatar Oct 24 '18 06:10 TopTime1

I'm tried but not working for me.

fevziomurtekin avatar Oct 24 '18 06:10 fevziomurtekin

     @Override
    public void onClick(View v) {
     ...
     ...    
        case R.id.imgPaylas:
                imgPaylas.setEnabled(false); btnCrop.setEnabled(true);
                ((MainActivity)getAct()).setToolbarName(getAct().getString(R.string.duzenle));
                dorper=true;
                final Uri uris =takeScreenShot(dorper);
                croppedImage.load(uris).execute(mLoadCallback);
                break;

            case R.id.btnUsePicture:
                btnCrop.setEnabled(false); imgPaylas.setEnabled(true);
                saveUri = Util.createNewUri(getContext(),format);
                croppedImage.crop(path)
                        .outputWidth((int) (getWidth()/1.05))
                        .execute(mCropCallback);
                break;
}

I did it in the form of "task java.util.concurrent.FutureTask@e9a5deb rejected from java.util.concurrent.ThreadPoolExecutor@f19c748 [Terminated, pool size = 0]          at java.util.concurrent.ThreadPoolExecutor $ AbortPolicy.rejectedExecution (ThreadPoolExecutor.java:2049) " is returning the error.

@mlnkrish @tinsukE @TopTime1

fevziomurtekin avatar Oct 24 '18 07:10 fevziomurtekin