timeout has expired, giving up wake lock!

匿名 (未验证) 提交于 2019-12-03 09:19:38

问题:

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();}   

回答1:

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



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!