<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    隨筆-1  評論-68  文章-98  trackbacks-0

    在主屏的設置墻紙界面,由于墻紙圖片太大,瀏覽墻紙大圖的預覽圖時,產生了OOM錯誤。

    異常提示:

    E/InputManagerService(  177): Got RemoteException sending setActive(false) notification
    E/InputManagerService(  177): android.os.DeadObjectException
    E/InputManagerService(  177):   at android.os.BinderProxy.transact(Native Method)
    E/InputManagerService(  177):   at com.android.internal.view.IInputMethodClient$Stub$Proxy.setActive(IInputMethodClient.java:158)
    E/InputManagerService(  177):   at com.android.server.InputMethodManagerService.unbindCurrentInputLocked(InputMethodManagerService.java:554)
    E/InputManagerService(  177):   at com.android.server.InputMethodManagerService.startInputLocked(InputMethodManagerService.java:616)
    E/InputManagerService(  177):   at com.android.server.InputMethodManagerService.startInput(InputMethodManagerService.java:700)
    E/InputManagerService(  177):   at com.android.internal.view.IInputMethodManager$Stub.onTransact(IInputMethodManager.java:113)
    E/InputManagerService(  177):   at com.android.server.InputMethodManagerService.onTransact(InputMethodManagerService.java:466)
    E/InputManagerService(  177):   at android.os.Binder.execTransact(Binder.java:276)
    E/InputManagerService(  177):   at dalvik.system.NativeStart.run(Native Method)

    代碼部分:

    public class com.android.launcher.WallpaperChooser


        @Override
        public void onCreate(Bundle icicle) {
            super.onCreate(icicle);
            requestWindowFeature(Window.FEATURE_NO_TITLE);

            findWallpapers();

            setContentView(R.layout.wallpaper_chooser);

            mOptions = new BitmapFactory.Options();
            mOptions.inDither = false;
            mOptions.inPreferredConfig = Bitmap.Config.ARGB_8888;
            mOptions.inSampleSize = 2;// fix it
    ... ...

        public void onItemSelected(AdapterView parent, View v, int position, long id) {
            final ImageView view = mImageView;
            Bitmap b = BitmapFactory.decodeResource(getResources(), IMAGE_IDS[position], mOptions);// here throw the OOMError

    ... ...

    解決方法:

    1、調整merory useage

    mOptions.inSampleSize = 2;//return an image that is 1/2 the width/height of the original, and 1/4 the number of pixels.

    2、調整bitmap size

    bitmap = Bitmap.createScaledBitmap(bitmap, 100, 150, false);

    3、調整temp storage

    mOptions.inSampleSize = new byte[100 * 1024];

    參考:http://stackoverflow.com/questions/477572/android-strange-out-of-memory-issue

     

    本文來自CSDN博客,轉載請標明出處:http://blog.csdn.net/netpirate/archive/2009/06/10/4257854.aspx

    posted on 2009-08-29 23:28 Xu Jianxiang 閱讀(328) 評論(0)  編輯  收藏 所屬分類: Android
    主站蜘蛛池模板: 久久久久亚洲av无码专区喷水| 青青草97国产精品免费观看| 91视频免费网址| 永久免费的网站在线观看| 亚洲最大的视频网站| 亚洲视频免费一区| 亚洲av无码电影网| 免费无码黄网站在线观看| 亚洲精品卡2卡3卡4卡5卡区| 亚洲综合小说久久另类区| 最近中文字幕完整版免费高清| 亚洲精品第一国产综合精品| 精品香蕉在线观看免费| 久久亚洲综合色一区二区三区| 久久精品熟女亚洲av麻豆 | 亚洲精品人成无码中文毛片| 五月婷婷免费视频| 亚洲国产成人高清在线观看| 亚洲免费视频在线观看| 毛茸茸bbw亚洲人| 免费91最新地址永久入口 | 免费无码一区二区三区蜜桃大| MM1313亚洲国产精品| 亚洲日韩中文字幕日韩在线| 亚洲日本VA午夜在线影院| 国产免费av一区二区三区| a一级爱做片免费| 亚洲影院在线观看| 成人免费无码大片a毛片软件| 亚洲国产电影在线观看| 久久久国产精品无码免费专区| 亚洲成av人片不卡无码| 国产一区二区三区免费在线观看| 久久成人18免费网站| 亚洲精品美女在线观看| yy6080久久亚洲精品| 在线观看亚洲免费视频| 四虎永久成人免费| 久久久久久久久久国产精品免费| 亚洲中文字幕无码久久| 浮力影院第一页小视频国产在线观看免费 |