在android中创建bitmap避免内存不足的方法

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.miz.heapsize"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="11" />

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:largeHeap="true" >
        <activity
            android:label="@string/app_name"
            android:name=".MainActivity" >
            <intent-filter >
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>
 
 
只需要加上<pre name="code" class="html">android:largeHeap="true"
 
 
可以生成48M的  哦耶
http://www.google.com/url?q=http%3A%2F%2Fstackoverflow.com%2Fquestions%2F8675037%2Fdoes-androids-large-heap-option-work-for-older-phones-upgraded-to-ics&sa=D&sntz=1&usg=AFQjCNE43aD9kOt0M5OUzNWaNGXP5pSM8w
 
 
 

你可能感兴趣的:(android,bitmap,内存)