app close when keep moving from landscape to portrait and sending value from one activity to another activity

StackOverflow https://stackoverflow.com/questions/10267979

Question

my application keep sudden close without any notice when i keep moving from landscape to portrait and vice versa, i also get the same error from keep sending value from one activity to another activity. Here is some error that i get from LogCat:

Log from keep moving landscape and portrait

04-22 20:23:31.110: E/dalvikvm-heap(6275): 5891496-byte external allocation too large for this process.
04-22 20:23:31.120: E/dalvikvm(6275): Out of memory: Heap Size=5639KB, Allocated=3205KB, Bitmap Size=22062KB, Limit=32768KB
04-22 20:23:31.120: E/dalvikvm(6275): Trim info: Footprint=5639KB, Allowed Footprint=5639KB, Trimmed=496KB
04-22 20:23:31.120: E/GraphicsJNI(6275): VM won't let us allocate 5891496 bytes

Log from keep sending value from one activity to another activity

04-22 21:57:04.497: D/dalvikvm(9570): GC_EXTERNAL_ALLOC freed 19K, 47% free 2901K/5379K, external 1151K/1663K, paused 24ms
04-22 21:57:04.647: D/dalvikvm(9570): GC_EXTERNAL_ALLOC freed 85K, 45% free 2960K/5379K, external 2320K/2875K, paused 24ms
04-22 21:57:04.807: D/dalvikvm(9570): GC_EXTERNAL_ALLOC freed 2K, 45% free 2960K/5379K, external 8073K/10082K, paused 23ms
04-22 21:57:04.927: D/ATRecorder(9570): com.htc.autotest.dlib.RecordEngine in loader dalvik.system.DexClassLoader@4053a410
04-22 21:57:04.937: D/ATRecorder(9570): com.htc.autotest.dlib.RecordEngine in loader dalvik.system.DexClassLoader@405316d0
04-22 21:57:04.937: D/WindowManagerImpl(9570): addView, new view, mViews[1]: com.android.internal.policy.impl.PhoneWindow$DecorView@40515820
04-22 21:57:05.227: D/WindowManagerImpl(9570): finishRemoveViewLocked, mViews[0]: com.android.internal.policy.impl.PhoneWindow$DecorView@40522768
04-22 21:57:06.158: D/View(9570): onTouchEvent: viewFlags: 0x18004081
04-22 21:57:06.158: D/View(9570): onTouchEvent: isFocusable: true, isFocusableInTouchMode: false, isFocused: false; focusTaken: false
04-22 21:57:06.238: D/ATRecorder(9570): com.htc.autotest.dlib.RecordEngine in loader dalvik.system.DexClassLoader@4054e1f0
04-22 21:57:06.529: D/View(9570): onTouchEvent: viewFlags: 0x18004081
04-22 21:57:06.529: D/View(9570): onTouchEvent: isFocusable: true, isFocusableInTouchMode: false, isFocused: false; focusTaken: false
04-22 21:57:06.549: D/ATRecorder(9570): com.htc.autotest.dlib.RecordEngine in loader dalvik.system.DexClassLoader@40559870
04-22 21:57:07.019: D/dalvikvm(9570): GC_EXTERNAL_ALLOC freed 83K, 45% free 3035K/5447K, external 13863K/15875K, paused 25ms
04-22 21:57:07.129: D/View(9570): onTouchEvent: viewFlags: 0x18004081
04-22 21:57:07.129: D/View(9570): onTouchEvent: isFocusable: true, isFocusableInTouchMode: false, isFocused: false; focusTaken: false
04-22 21:57:07.149: D/ATRecorder(9570): com.htc.autotest.dlib.RecordEngine in loader dalvik.system.DexClassLoader@40552178
04-22 21:57:07.289: D/View(9570): onTouchEvent: viewFlags: 0x18004081
04-22 21:57:07.289: D/View(9570): onTouchEvent: isFocusable: true, isFocusableInTouchMode: false, isFocused: false; focusTaken: false
04-22 21:57:07.369: D/dalvikvm(9570): GC_EXTERNAL_ALLOC freed 34K, 44% free 3058K/5447K, external 12711K/14759K, paused 26ms
04-22 21:57:07.600: D/ATRecorder(9570): com.htc.autotest.dlib.RecordEngine in loader dalvik.system.DexClassLoader@40534f78
04-22 21:57:08.050: D/View(9570): onTouchEvent: viewFlags: 0x18004081
04-22 21:57:08.050: D/View(9570): onTouchEvent: isFocusable: true, isFocusableInTouchMode: false, isFocused: false; focusTaken: false
04-22 21:57:08.050: D/ATRecorder(9570): com.htc.autotest.dlib.RecordEngine in loader dalvik.system.DexClassLoader@4053da60
04-22 21:57:08.421: D/View(9570): onTouchEvent: viewFlags: 0x18004081
04-22 21:57:08.421: D/View(9570): onTouchEvent: isFocusable: true, isFocusableInTouchMode: false, isFocused: false; focusTaken: false
04-22 21:57:08.431: D/ATRecorder(9570): com.htc.autotest.dlib.RecordEngine in loader dalvik.system.DexClassLoader@4055caf0
04-22 21:57:08.771: D/View(9570): onTouchEvent: viewFlags: 0x18004081
04-22 21:57:08.771: D/View(9570): onTouchEvent: isFocusable: true, isFocusableInTouchMode: false, isFocused: false; focusTaken: false
04-22 21:57:08.841: D/dalvikvm(9570): GC_EXTERNAL_ALLOC freed 55K, 44% free 3092K/5447K, external 18465K/18465K, paused 24ms
04-22 21:57:09.091: D/ATRecorder(9570): com.htc.autotest.dlib.RecordEngine in loader dalvik.system.DexClassLoader@40530708
04-22 21:57:09.201: D/dalvikvm(9570): GC_EXTERNAL_ALLOC freed 9K, 44% free 3093K/5447K, external 24218K/24218K, paused 24ms
04-22 21:57:09.321: D/dalvikvm(9570): GC_FOR_MALLOC freed <1K, 44% free 3092K/5447K, external 24218K/24218K, paused 17ms
04-22 21:57:09.341: D/View(9570): onTouchEvent: viewFlags: 0x18004081
04-22 21:57:09.341: D/View(9570): onTouchEvent: isFocusable: true, isFocusableInTouchMode: false, isFocused: false; focusTaken: false
04-22 21:57:09.351: D/ATRecorder(9570): com.htc.autotest.dlib.RecordEngine in loader dalvik.system.DexClassLoader@4055df78
04-22 21:57:09.542: D/View(9570): onTouchEvent: viewFlags: 0x18004081
04-22 21:57:09.542: D/View(9570): onTouchEvent: isFocusable: true, isFocusableInTouchMode: false, isFocused: false; focusTaken: false
04-22 21:57:09.542: D/ATRecorder(9570): com.htc.autotest.dlib.RecordEngine in loader dalvik.system.DexClassLoader@40566488
04-22 21:57:09.692: D/dalvikvm(9570): GC_EXTERNAL_ALLOC freed 70K, 44% free 3098K/5511K, external 24218K/24218K, paused 30ms
04-22 21:57:09.812: D/dalvikvm(9570): GC_FOR_MALLOC freed 5K, 44% free 3093K/5511K, external 24218K/24218K, paused 17ms
04-22 21:57:09.872: D/View(9570): onTouchEvent: viewFlags: 0x18004081
04-22 21:57:09.872: D/View(9570): onTouchEvent: isFocusable: true, isFocusableInTouchMode: false, isFocused: false; focusTaken: false
04-22 21:57:09.882: D/ATRecorder(9570): com.htc.autotest.dlib.RecordEngine in loader dalvik.system.DexClassLoader@4054bd48
04-22 21:57:10.312: D/View(9570): onTouchEvent: viewFlags: 0x18004081
04-22 21:57:10.312: D/View(9570): onTouchEvent: isFocusable: true, isFocusableInTouchMode: false, isFocused: false; focusTaken: false
04-22 21:57:10.412: D/dalvikvm(9570): GC_EXTERNAL_ALLOC freed 51K, 44% free 3099K/5511K, external 24218K/24218K, paused 24ms
04-22 21:57:10.533: D/dalvikvm(9570): GC_FOR_MALLOC freed 3K, 44% free 3096K/5511K, external 24218K/24218K, paused 17ms
04-22 21:57:10.613: D/dalvikvm(9570): GC_EXTERNAL_ALLOC freed <1K, 44% free 3097K/5511K, external 24218K/24218K, paused 28ms
04-22 21:57:10.613: E/dalvikvm-heap(9570): 5891496-byte external allocation too large for this process.
04-22 21:57:10.613: E/dalvikvm(9570): Out of memory: Heap Size=5511KB, Allocated=3097KB, Bitmap Size=24218KB, Limit=32768KB
04-22 21:57:10.613: E/dalvikvm(9570): Trim info: Footprint=5511KB, Allowed Footprint=5511KB, Trimmed=448KB
04-22 21:57:10.613: E/GraphicsJNI(9570): VM won't let us allocate 5891496 bytes

and here is my code when i send the value: result.java

public class result extends Activity {
      public static String destination = "";

search.java

public void setButtonClickListener() {
    Button searchButton = (Button)findViewById(R.id.buttonSearch);
    searchButton.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
              result.destination = textView.getText().toString();
              TabHost tabHost =  (TabHost) getParent().findViewById(android.R.id.tabhost);
              tabHost.setCurrentTab(0);
        }
        });
}

My application was using tab view with three different activity. I also used .jpg for background and there is an image view inside tabs. I've read answer from External allocation too large for this process in Android but i didn't quiet understand it. can someone tell me in easier way how to handle it? or where should i look for the answer?

for the sending value memory problem, i think the possible problem is in the moving between tab because when i keep moving between tab, the same error also appear.

Was it helpful?

Solution

Add these line for activity in your manifeast file:::

<activity
        android:configChanges="keyboardHidden|orientation"
        android:name=".Activity">
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top