如何解决android asynctask loadfile错误?

时间:2013-10-17 23:49:37

标签: android android-asynctask bmp

AsyncTask loadfile在函数中返回bmp 它只是android OS 3.12唯一的错误 我如何优化asyncTask?

            File tileFile = null;

            tileFile = layerTmp.urlMaker_.makeCacheFile(DEFAULT_TILE_CACHE_PATH, tileTmp.tileCoords, (mapView_.getZoomLevel() - mapView_.getAdjustLevelPoint()), layer.layerName_);

            if(tileFile != null) {
                fis = new FileInputStream(tileFile);
            } else {
                throw new Exception("load error");
            }

            out = new ByteArrayOutputStream();
            bis = new BufferedInputStream(fis);

            if (isCancelled()) throw new Exception("task cancel");

            boolean isComplete = false;
            isComplete = interruptableStreamCopy(bis, out);

            if (!isComplete) throw new Exception("task cancel");
            out.flush();

            final byte[] data = out.toByteArray();
            out.close();

            BitmapFactory.Options options = new BitmapFactory.Options();
            options.inPreferredConfig = Bitmap.Config.RGB_565;              
            options.inDither = false; //Disable Dithering mode
            options.inPurgeable=true;                   //Tell to gc that whether it needs free memory, the Bitmap can be cleared
            options.inInputShareable=true;              //Which kind of reference will be used to recover the Bitmap data after being clear, when it will be used in the future
            options.inTempStorage=new byte[32 * 1024]; 

            bmp = BitmapFactory.decodeByteArray(data, 0, data.length, options);

            if (bmp  == null) {
                if(tileFile != null)
                    tileFile.delete();

                try {
                    throw new IOException("Image file was not decodable: "+ tileFile);
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }

            if (isCancelled()) throw new Exception("task cancel");

            if (mapView_.getAdjustLevelPoint() > 0) {
                bmp = Bitmap.createScaledBitmap(bmp , bmp.getWidth() << mapView_.getAdjustLevelPoint(), bmp.getHeight() << mapView_.getAdjustLevelPoint(), true);
            }
  

10-18 08:40:15.095:I / DEBUG(30889): * * * * * * *   * * * * * * * < / em> * * 10-18 08:40:15.095:I / DEBUG(30889):构建指纹:   &#39; LGE / express_lgu_kr /表达:3.2.1 / HTK75D / LG-LU8300-V130.47A6032B:用户/释放密钥&#39;   10-18 08:40:15.095:I / DEBUG(30889):pid:31983,tid:31983&gt;&gt;&gt;   kr.co.lgupgis.map&lt;&lt;&lt; 10-18 08:40:15.095:I / DEBUG(30889):信号11   (SIGSEGV),代码1(SEGV_MAPERR),故障地址595b7900 10-18   08:40:15.095:I / DEBUG(30889):r0 413784bc r1 595b7900 r2 00000200   r3 00000000 10-18 08:40:15.095:I / DEBUG(30889):r4 595b7800 r5   413783bc r6 000000e5 r7 00000200 10-18 08:40:15.095:I / DEBUG(30889):   r8 00000d00 r9 00000100 10 00000200 fp 40fa67c8 10-18 08:40:15.095:   I / DEBUG(30889):ip 00000002 sp be91decc lr ab18d714 pc aff0c9a8   cpsr 20000010 10-18 08:40:15.095:I / DEBUG(30889):d0   ffd7ffd7ffd7d696 d1 ffd7ffd7ffd7ffd7 10-18 08:40:15.095:   I / DEBUG(30889):d2 ffd7ffd7ffd7ffd7 d3 ffd7ffd7ffd7ffd7 10-18   08:40:15.095:I / DEBUG(30889):d4 ffd7ffd7ffd7ffd7 d5   ffd7ffd7ffd7ffd7 10-18 08:40:15.095:I / DEBUG(30889):d6   ffd7ffd7ffd7ffd7 d7 ffd7ffd7ffd7ffd7 10-18 08:40:15.095:   I / DEBUG(30889):d8 0000037a3f000000 d9 4433c000000003cf 10-18   08:40:15.095:I / DEBUG(30889):d10 3f7b9adfe3dff7b1 d11   3fe53923e0c21ab4 10-18 08:40:15.095:I / DEBUG(30889):d12   3f63fa43864086f2 d13 3ee0ba74ce830ace 10-18 08:40:15.095:   I / DEBUG(30889):d14 3e664d97e3daa951 d15 3df0179b74c46cff 10-18   08:40:15.095:I / DEBUG(30889):d16 ffd7ffd7ffd7ffd7 d17   ffd7ffd7ffd7ffd7 10-18 08:40:15.095:I / DEBUG(30889):d18   ffd7ffd7ffd7ffd7 d19 ffd7ffd7ffd7ffd7 10-18 08:40:15.095:   I / DEBUG(30889):d20 ffd7ffd7ffd7ffd7 d21 ffd7ffd7ffd7ffd7 10-18   08:40:15.095:I / DEBUG(30889):d22 ffd7ffd7ffd7ffd7 d23   ffd7ffd7ffd7ffd7 10-18 08:40:15.095:I / DEBUG(30889):d24   ce00ff00fa05ea15 d25 ff00ff00ff00de00 10-18 08:40:15.095:   I / DEBUG(30889):d26 c700fb00fa05ea15 d27 f700f700f700d700 10-18   08:40:15.095:I / DEBUG(30889):d28 fffc8934fffc8934 d29   fffc8934fffc8934 10-18 08:40:15.095:I / DEBUG(30889):d30   0001000000010000 d31 0001000000010000 10-18 08:40:15.095:   I / DEBUG(30889):scr 20000012 10-18 08:40:15.175:I / DEBUG(30889):

     

00 pc 0000c9a8 /system/lib/libc.so 10-18 08:40:15.175:I / DEBUG(30889):#01 lr ab18d714 /system/lib/libskia.so

     

10-18 08:40:15.175:I / DEBUG(30889):libc基地址:aff00000 10-18   08:40:15.175:I / DEBUG(30889):pc周围的代码:10-18 08:40:15.175:   I / DEBUG(30889):aff0c988 f461428d e25cc001 f400028d f400428d 10-18   08:40:15.175:I / DEBUG(30889):aff0c998 f440028d f440428d 1afffff4   e3a0c006 10-18 08:40:15.175:I / DEBUG(30889):aff0c9a8 f421028d   f421428d f461028d f461428d 10-18 08:40:15.175:I / DEBUG(30889):   aff0c9b8 e25cc001 f400028d f400428d f440028d 10-18 08:40:15.175:   I / DEBUG(30889):aff0c9c8 f440428d 1afffff5 e212207f 0a00001e 10-18   08:40:15.175:I / DEBUG(30889):代码左右:10-18 08:40:15.175:   I / DEBUG(30889):ab18d6f4 e0243e97 e08b5002 e0804004 e1a00005 10-18   08:40:15.175:I / DEBUG(30889):ab18d704 e1a01004 e2866001 e1a0200a   ebfe7597 10-18 08:40:15.175:I / DEBUG(30889):ab18d714 e1560009   e0855008 e0844007 1afffff6 10-18 08:40:15.175:I / DEBUG(30889):   ab18d724 e8bd8ff8 e590c004 e92d4ff0 e1a05003 10-18 08:40:15.175:   I / DEBUG(30889):ab18d734 e59c6018 e24dd014 e5903008 e1a0e081 10-18   08:40:15.175:I / DEBUG(30889):stack:10-18 08:40:15.175:   I / DEBUG(30889):be91de8c ab16e9cc /system/lib/libskia.so 10-18   08:40:15.175:I / DEBUG(30889):be91de90 001b6944 10-18   08:40:15.175:I / DEBUG(30889):be91de94 001b6944 10-18   08:40:15.175:I / DEBUG(30889):be91de98 5959b000 10-18   08:40:15.175:I / DEBUG(30889):be91de9c ab14f218   /system/lib/libskia.so 10-18 08:40:15.175:I / DEBUG(30889):
  be91dea0 00000000 10-18 08:40:15.175:I / DEBUG(30889):be91dea4   001b6944 10-18 08:40:15.175:I / DEBUG(30889):be91dea8 be91e03c   10-18 08:40:15.175:I / DEBUG(30889):be91deac ab165dd4   /system/lib/libskia.so 10-18 08:40:15.175:I / DEBUG(30889):
  be91deb0 ab204b80 10-18 08:40:15.175:I / DEBUG(30889):be91deb4   ab18d3b8 /system/lib/libskia.so 10-18 08:40:15.175:I / DEBUG(30889):
  be91deb8 be91e03c 10-18 08:40:15.175:I / DEBUG(30889):be91debc   ab14e4d8 /system/lib/libskia.so 10-18 08:40:15.175:I / DEBUG(30889):
  be91dec0 df002777 10-18 08:40:15.175:I / DEBUG(30889):be91dec4   e3a070ad 10-18 08:40:15.175:I / DEBUG(30889):be91dec8 be91e160   10-18 08:40:15.175:I / DEBUG(30889):#00 be91decc 413783bc 10-18   08:40:15.175:I / DEBUG(30889):be91ded0 00000100 10-18   08:40:15.175:I / DEBUG(30889):be91ded4 001b68f0 10-18   08:40:15.175:I / DEBUG(30889):be91ded8 000004cf 10-18   08:40:15.175:I / DEBUG(30889):be91dedc 00193bd0 10-18   08:40:15.175:I / DEBUG(30889):be91dee0 be91e160 10-18   08:40:15.175:I / DEBUG(30889):be91dee4 00000001 10-18   08:40:15.175:I / DEBUG(30889):be91dee8 be91e1f8 10-18   08:40:15.175:I / DEBUG(30889):be91deec be91e03c 10-18   08:40:15.175:I / DEBUG(30889):be91def0 0000027a 10-18   08:40:15.175:I / DEBUG(30889):be91def4 ab171880   /system/lib/libskia.so 10-18 08:40:15.175:I / DEBUG(30889):
  be91def8 00000100 10-18 08:40:15.175:I / DEBUG(30889):be91defc   be91e03c 10-18 08:40:15.175:I / DEBUG(30889):be91df00 00000124   10-18 08:40:15.175:I / DEBUG(30889):be91df04 00000000 10-18   08:40:15.175:I / DEBUG(30889):be91df08 000003cf 10-18   08:40:15.175:I / DEBUG(30889):be91df0c be91e03c 10-18   08:40:15.175:I / DEBUG(30889):be91df10 000000c0 10-18   08:40:15.355:D / RPC(352):3000008c:00050000收到CALL。 10-18   08:40:15.355:D / libloc(352):事件RPC_LOC_EVENT_NMEA_1HZ_REPORT   (客户1)10-18 08:40:15.355:D / libloc(352):   loc_eng_process_loc_event:4 10-18 08:40:15.355:D / libloc(352):   loc_eng_report_nmea:$ GSV 10-18 08:40:15.355:D / libloc(352):事件   RPC_LOC_EVENT_NMEA_1HZ_REPORT(客户端1)10-18 08:40:15.355:   D / libloc(352):loc_eng_process_loc_event:4 10-18 08:40:15.355:   D / libloc(352):loc_eng_report_nmea:$ VTG 10-18 08:40:15.355:   D / RPC(352):3000008c:00050000调度RPC调用(XID 681125,xdr   0x395820)用于回调客户端3100008c:00050001。 10-18 08:40:15.355:   D / RPC(352):3100008c:327681发送RPC回复(XID 681125)10-18   08:40:15.355:D / RPC(352):3000008c:00050000收到CALL。 10-18   08:40:15.355:D / RPC(352):3000008c:00050000调度RPC调用(XID   681126,xdr 0x395820)用于回调客户端3100008c:00050001。 10-18   08:40:15.355:D / RPC(352):3100008c:327681发送RPC回复(XID   681126)10-18 08:40:15.375:D / RPC(352):3000008c:00050000收到   呼叫。 10-18 08:40:15.375:D / libloc(352):事件   RPC_LOC_EVENT_NMEA_1HZ_REPORT(客户端1)10-18 08:40:15.375:   D / libloc(352):loc_eng_process_loc_event:4 10-18 08:40:15.375:   D / libloc(352):loc_eng_report_nmea:$ GSA 10-18 08:40:15.375:   D / RPC(352):3000008c:00050000调度RPC调用(XID 681127,xdr   0x395820)用于回调客户端3100008c:00050001。 10-18 08:40:15.375:   D / RPC(352):3100008c:327681发送RPC回复(XID 681127)10-18   08:40:15.395:D / RPC(352):3000008c:00050000收到CALL。 10-18   08:40:15.395:D / libloc(352):事件RPC_LOC_EVENT_NMEA_1HZ_REPORT   (客户1)10-18 08:40:15.395:D / libloc(352):   loc_eng_process_loc_event:4 10-18 08:40:15.395:D / libloc(352):   loc_eng_report_nmea:$ GGA 10-18 08:40:15.395:D / RPC(352):   3000008c:00050000调度RPC调用(XID 681128,xdr 0x395820)   回调客户端3100008c:00050001。 10-18 08:40:15.415:D / RPC(352):   3100008c:327681发送RPC回复(XID 681128)10-18 08:40:15.415:   D / RPC(352):3000008c:00050000收到CALL。 10-18 08:40:15.415:   D / libloc(352):事件RPC_LOC_EVENT_NMEA_1HZ_REPORT(客户端1)10-18   08:40:15.415:D / libloc(352):loc_eng_process_loc_event:4 10-18   08:40:15.415:D / libloc(352):loc_eng_report_nmea:$ RMC 10-18   08:40:15.415:D / RPC(352):3000008c:00050000调度RPC调用(XID   681129,xdr 0x395820)用于回调客户端3100008c:00050001。 10-18   08:40:15.415:D / RPC(352):3100008c:327681发送RPC回复(XID   681129)10-18 08:40:15.435:D / RPC(352):3000008c:00050000已收到   呼叫。 10-18 08:40:15.435:D / libloc(352):事件   RPC_LOC_EVENT_SATELLITE_REPORT(客户端1)10-18 08:40:15.435:   D / libloc(352):sv count:11 10-18 08:40:15.435:D / RPC(352):   3000008c:00050000调度RPC调用(XID 681130,xdr 0x395820)   回调客户端3100008c:00050001。 10-18 08:40:15.455:V / libloc(352):   sv列表:10-18 08:40:15.455:V / libloc(352):     sys prn hlth proc eph alm elev azi snr 10-18 08:40:15.455:   V / libloc(352):0:1 1 -1 2 0 1 18.000 188.000 0.000 10-18   08:40:15.455:V / libloc(352):1:1 3 -1 2 0 1 60.000 36.000 0.000   10-18 08:40:15.455:V / libloc(352):2:     1 9 -1 2 0 1 16.000 319.000 0.000 10-18 08:40:15.455:V / libloc(352):   3:1 13 -1 2 0 1 17.000 239.000 0.000 10-18 08:40:15.455:   V / libloc(352):4:5 10 -1 2 0 1 30.000 329.000 0.000 10-18   08:40:15.455:V / libloc(352):5:5 2 -1 2 0 1 -1.000 -1.000 0.000   10-18 08:40:15.455:V / libloc(352):6:     5 18 -1 2 0 1 19.000 35.000 0.000 10-18 08:40:15.455:V / libloc(352):   7:5 9 -1 2 0 1 84.000 338.000 0.000 10-18 08:40:15.455:   V / libloc(352):8:5 16 -1 2 0 1 37.000 146.000 0.000 10-18   08:40:15.455:V / libloc(352):9:5 20 -1 2 0 1 33.000 233.000 0.000   10-18 08:40:15.455:V / libloc(352):10:     5 19 -1 2 0 1 75.000 309.000 0.000 10-18 08:40:15.455:D / libloc(352):   loc_eng_process_loc_event:2 10-18 08:40:15.455:   D / GpsLocationProvider(352):reportSvStatus 10-18 08:40:15.455:   D / GpsLocationProvider(352):updateStatus 10-18 08:40:15.475:   D / RPC(352):3100008c:327681发送RPC回复(XID 681130)10-18   08:40:15.595:I / BootReceiver(352):正在复制   / data / tombstones / tombstone_05到DropBox(SYSTEM_TOMBSTONE)10-18   08:40:15.605:I / DEBUG(30889):分离10-18 08:40:15.605:   I / DEBUG(30889):调试者自杀以释放僵尸! 10-18   08:40:15.665:E / JavaBinder(352):在Java对象中的0x7b8030上进行Transact   0x4089e728代码3失败10-18 08:40:15.665:   V / GpsLocationProvider(352):getListenerPackageName()packages =   [android.uid.system:1000] uid = [1000] 10-18 08:40:15.665:   E / InputDispatcher(352):channel&#39; 40a1e410(server)&#39; 〜消费者关闭   输入通道或发生错误。 events = 0x8 10-18 08:40:15.665:   E / InputDispatcher(352):channel&#39; 40a1e410(server)&#39; 〜频道是   不可挽回的破碎,将被处置!

0 个答案:

没有答案