<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 閱讀(1477) 評論(0)  編輯  收藏 所屬分類: Android
    主站蜘蛛池模板: 好男人看视频免费2019中文| 亚洲一区二区三区免费视频| 亚洲成av人片一区二区三区| 九九精品国产亚洲AV日韩| 久久不见久久见中文字幕免费 | 少妇无码一区二区三区免费| 亚洲w码欧洲s码免费| 18观看免费永久视频| 亚洲欧洲久久久精品| 丝袜捆绑调教视频免费区| 好看的亚洲黄色经典| 美女在线视频观看影院免费天天看 | 免费理论片51人人看电影| 亚洲sm另类一区二区三区| 日本a级片免费看| 人妻无码中文字幕免费视频蜜桃| 亚洲国产精品第一区二区三区| 中国极品美軳免费观看| 亚洲国产女人aaa毛片在线| 久久WWW免费人成一看片| 亚洲精品人成网线在线播放va| 亚洲第一黄片大全| 久久国产精品免费网站| 亚洲人色大成年网站在线观看| 男女啪啪永久免费观看网站| 一级免费黄色大片| 久久久亚洲欧洲日产国码aⅴ| 在线播放免费人成视频网站| 精品久久香蕉国产线看观看亚洲| 久久免费美女视频| 亚洲中文字幕乱码AV波多JI| 久久久久亚洲AV成人网人人软件| 中文字幕成人免费视频| 亚洲av片在线观看| 久久青青草原亚洲AV无码麻豆| 国产精品小视频免费无限app| 亚洲综合婷婷久久| 国产在线a不卡免费视频| 久久综合国产乱子伦精品免费| 亚洲精品色播一区二区| 久久精品国产96精品亚洲|