【问题标题】:timeout has expired, giving up wake lock!超时已过期,放弃唤醒锁!
【发布时间】:2011-05-17 07:11:37
【问题描述】:

我有一个疑问...我不确定这是否是我的疏忽。 我正在使用 mBitmap.compress(Bitmap.CompressFormat.PNG,100, out); 将位图保存到 png 。 在代码中,此代码下方的行不会随之响应。 让我说清楚, 我在方法中的所有交替行中都给出了Log.i(xy,xy); 来跟踪问题,但是直到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();}  

【问题讨论】:

  • 那么,您的问题是什么?图像未正确压缩/保存,或者您没有看到跟踪日志?具有更清晰解释的代码的重要部分会有所帮助。
  • 我在 logcat 中没有得到任何响应。我的调试器有一些问题,它无法正常工作。
  • 恐怕在你解决这个问题之前你无法继续前进。

标签: android bitmap


【解决方案1】:

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

【讨论】:

  • 那么模拟器可能会强制关闭应用程序...或者不会响应应用程序上的任何点击...但对我来说它会响应
猜你喜欢
  • 1970-01-01
  • 2011-11-21
  • 1970-01-01
  • 2012-04-19
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-03-29
相关资源
最近更新 更多