5 messages in com.googlegroups.android-beginnersRe: [android-beginners] Re: Java.lang...
FromSent OnAttachments
LE THANH TUNG26 Mar 2008 11:15 
tim jones26 Mar 2008 19:31 
LE THANH TUNG26 Mar 2008 23:13 
Dan U.27 Mar 2008 00:03 
LE THANH TUNG27 Mar 2008 01:09 
Subject:Re: [android-beginners] Re: Java.lang.OutOfMemory !
From:LE THANH TUNG (tung@gmail.com)
Date:03/27/2008 01:09:41 AM
List:com.googlegroups.android-beginners

Thank you, Dan and sorry :)!

On Thu, Mar 27, 2008 at 2:03 PM, Dan U. <dan.@gmail.com> wrote:

I seem to remember this code. Is there a reason you did not use finish() in your mBackListener like I suggested? I'd guess that might be your problem.

On Mar 26, 11:14 pm, "LE THANH TUNG" <tung@gmail.com> wrote:

Dear Tim !

Thank you for your interest.

Each screen, I use 2 intents to forward to another window and return to previous window. The code is always the same except parameter (but similarly).

I show here the code, please teach me if there should be a method to kill process. Or if because of the leak of Memory, how to increase ? My RAM is 512M, chip is 1,8GHz

*Code* :

package com.google.tung.englishtest.grammar;

import com.google.tung.englishtest.Introduction;

import com.google.tung.englishtest.R; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button;

public class Cau_1_grammar extends Activity { @Override protected void onCreate(Bundle icicle) { super.onCreate(icicle);

setContentView(R.layout.cau_1_grammar);

Button goButton = (Button)findViewById( R.id.cau_1_continue_grammar); goButton.setOnClickListener(mGoListener); Button backButton = (Button)findViewById( R.id.cau_1_back_grammar); backButton.setOnClickListener(mBackListener); }

private OnClickListener mGoListener = new OnClickListener() { public void onClick(View v) { // to forward to Cau_2 Intent intent = new Intent(); intent.setClass(Cau_1_grammar.this,Cau_2_grammar.class); startActivity(intent); } }; private OnClickListener mBackListener = new OnClickListener() { public void onClick(View v) { // Turn back to Cau_1 Intent intent = new Intent(); intent.setClass(Cau_1_grammar.this,Introduction.class); startActivity(intent); } };

}

Thank you, Tim.

Anybody can help ?

Please let me know if you have any question.

On Thu, Mar 27, 2008 at 9:31 AM, tim jones <tcr@gmail.com> wrote:

Not unless you want to tell us what you are doing. Maybe a memory leak?

On Wed, Mar 26, 2008 at 1:16 PM, LE THANH TUNG < tung@gmail.com> wrote:

Hi all !

I am testing an Android application with 45 UIs that I am doing. After transfer some interface, I got error : Java.lang.OutOfMemory error.

Is there any way to fix this error ? Please help !