私はTest1という単純なアクティビティを持っています。他のアクティビティを開始するとImageViewメモリリークが発生する
これはレイアウトコードです。私onDestory
方法で
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/test"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<ImageView
android:id="@+id/imageview1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:adjustViewBounds="true"
android:src="@drawable/load"
android:scaleType="fitXY" />
</RelativeLayout>
、私はmImageView
リソースを解放し、Androidのプロファイルで、mImageView
のメモリは、実際にリサイクルされています。
@Override
protected void onDestroy() {
super.onDestroy();
releaseImageViewResource(mImageView);
layout.removeView(mImageView);
mImageView.setVisibility(View.GONE);
mImageView.setImageDrawable(null);
mImageView = null;
}
しかし、私は他の単純な活動を開始すると、mImageView
のメモリを再利用することはできません。なぜ、どのように問題を解決するのですか?
「しかし、私は他の簡単なアクティビティを開始しますか?これは何を意味するのでしょうか? ImageViewで1回目のアクティビティを開始し、そのアクティビティから別のアクティビティを開始したことを意味しますか?少し詳しく説明できますか? – Henry
onDestroyまたはonDestroy()を記述したアクティビティは呼び出されず、 – notTdar