I am really total desperate. Since a week I am searching a memory leak in my App. I reduced everything to that little Activity attached.
The problem *occurres** **if the orientation changes. For example if I change the orientation in the emulator 6 times I have 6 Instances of my * *Activity in MAT. It seams as the ListView holds a reference to my Activity but I have no Idea how to get rid of this reference and how to solve that problem.* * * *Here are some MAT Screenshots... http://goo.gl/oovUI* Thanks in advance -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
package at.mikemitterer.android.memtest;
import android.app.Activity;
import android.content.res.Resources;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListAdapter;
import android.widget.ListView;
public class MemTestActivity extends Activity {
private static final String TAG = "MemTestActivity";
/** Called when the activity is first created. */
private ListView listviewLeft;
private ListAdapter mAdapter = null;
@Override
public void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
listviewLeft = (ListView) findViewById(R.id.left_signs_list_view);
if (mAdapter == null) {
mAdapter = new ArrayAdapter<String>(this, R.layout.sign, R.id.sign_name, new String[] { "Hallo", "Test" });
}
if (listviewLeft.getAdapter() == null) {
listviewLeft.setAdapter(mAdapter);
}
}
@Override
protected void onDestroy() {
listviewLeft.setAdapter(null);
//listviewRight.setAdapter(null);
recycleImages();
//unbindDrawables();
super.onDestroy();
}
@Override
protected void onPause() {
recycleImages();
super.onPause();
}
//---------------------------------------------------------------------------------------------
// private
//---------------------------------------------------------------------------------------------
}
sign.xml
Description: XML document
main.xml
Description: XML document
<<attachment: screenshot-706.jpg>>

