超时已到,放弃唤醒锁!

发布于 2024-11-07 12:39:28 字数 1939 浏览 0 评论 0原文

我有一个疑问……我不确定是否是我的粗心。 我使用 mBitmap.compress(Bitmap.compressFormat.PNG,100, out); 将位图保存为 png 。 在代码中,该代码下方的行不会随之响应。 让我说清楚, 我已经在方法中的所有交替行中给出了 Log.i(xy,xy); 来跟踪问题,但所有 Log 直到 mBitmap.compress(Bitmap.compressFormat 之前的行.PNG,100, out); 打印,我已将整个代码包含在 try-catch 中,但没有捕获任何异常。我检查了参数和对象是否为空,但它们不是。我在这里很困惑..请帮忙...

提前致谢

Logcat

05-17 10:07:24.819: WARN/ActivityManager(73): Launch timeout has expired, giving up wake lock!
05-17 10:07:24.849: WARN/ActivityManager(73): Activity idle timeout for ActivityRecord{40968180 com.test.android.sk/.FPaint}

编辑

    public String cReatePNG(){

        Log.i("cp1", "in the create png");

          try{
              Log.i("cp2", "in the create png");
              flag=true;
              DataBaseHelper  myDbHelper = new DataBaseHelper(this);

              String pattern= "dd-MM-yyyy-HHmmss"   ;
              SimpleDateFormat format = new SimpleDateFormat(pattern);
              String formattedDate = format.format(new Date());
            Log.i("cp3", "in the create png");
              tmpfile= CreateTempDir.createTempDir();

              File file = new File(Environment.getExternalStorageDirectory()
                + File.separator+"/SK_Temp/img-"+formattedDate+".png");

            try{

                Log.i("cp4", "in the create png"+file);    
                  FileOutputStream  out = new FileOutputStream(file);
                Log.i("cp5", "in the create png");    
                Log.i("view",out.toString());
                view.mBitmap.compress(Bitmap.CompressFormat.PNG,100,out); // <----issue with this line
             }catch(Exception e){ e.printStackTrace();}
                Log.i("CP#file_creation", "PNG file created");
                filename=file.toString();
            }catch(Exception e){e.printStackTrace();}  

I have a doubt...i am not sure whether its some carelessness from my part.
I was using mBitmap.compress(Bitmap.CompressFormat.PNG,100, out); to save a bitmap to png .
In the code the line beneath this code does not respond along with this.
Let me make it clear,
I have given Log.i(xy,xy); in all the alternating lines in the method to trace the issue, but all the Log until the line before mBitmap.compress(Bitmap.CompressFormat.PNG,100, out); prints and I have included the whole code in a try-catch, but no exception was caught. I have checked whether the parameter and the object were null, but no they are not. I am confused here..please help ...

Thanks in advance

Logcat

05-17 10:07:24.819: WARN/ActivityManager(73): Launch timeout has expired, giving up wake lock!
05-17 10:07:24.849: WARN/ActivityManager(73): Activity idle timeout for ActivityRecord{40968180 com.test.android.sk/.FPaint}

Edit

    public String cReatePNG(){

        Log.i("cp1", "in the create png");

          try{
              Log.i("cp2", "in the create png");
              flag=true;
              DataBaseHelper  myDbHelper = new DataBaseHelper(this);

              String pattern= "dd-MM-yyyy-HHmmss"   ;
              SimpleDateFormat format = new SimpleDateFormat(pattern);
              String formattedDate = format.format(new Date());
            Log.i("cp3", "in the create png");
              tmpfile= CreateTempDir.createTempDir();

              File file = new File(Environment.getExternalStorageDirectory()
                + File.separator+"/SK_Temp/img-"+formattedDate+".png");

            try{

                Log.i("cp4", "in the create png"+file);    
                  FileOutputStream  out = new FileOutputStream(file);
                Log.i("cp5", "in the create png");    
                Log.i("view",out.toString());
                view.mBitmap.compress(Bitmap.CompressFormat.PNG,100,out); // <----issue with this line
             }catch(Exception e){ e.printStackTrace();}
                Log.i("CP#file_creation", "PNG file created");
                filename=file.toString();
            }catch(Exception e){e.printStackTrace();}  

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

过潦 2024-11-14 12:39:28

该应用程序可能超出了VM buget并耗尽了内存。

The app could have exceeded the VM buget and ran out of memory..

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文