안녕하십니까..

소스안에 finish 또는 break 를 걸어도, 메모리 상에서는 해제가 되지 않는 것 같습니다..

 

onDestory 등으로 죽일려고해도.. 도통 어떻게 값을 받아와야 하는 지를 모르겠습니다..

 

recycle 를 시도 해 보려고 해도.. 제가 리니어 타입으로 4~5조각을 하나로 뭉쳐놨는데..

 

여러개의 jpg 는 어떻게 불러와야 하는 지도 모르겠습니다..

 

죄송하지만.. 죄송한건 정말 압니다만..

 

소스 수정을 간곡히 부탁드립니다..

 

28시간이 넘게 컴퓨터만 하고있습니다.. 책을 5권을 뒤져도 도저히 모르겠어요....

 

 

 

public class ana3 extends Activity implements OnClickListener {
 LinearLayout mainLayout;
 ImageView imageView;

 
  @Override
 
  public void onCreate(Bundle savedInstanceState) {
  
   requestWindowFeature(Window.FEATURE_NO_TITLE);
   getWindow().setFlags(Window.FEATURE_NO_TITLE, Window.FEATURE_NO_TITLE);

  
    super.onCreate(savedInstanceState);
    setContentView(R.layout.ana3);
  
   Button btn1 = (Button)findViewById(R.id.btn1);

   btn1.setOnClickListener(this);
  
 
  
   Button btn2 = (Button)findViewById(R.id.btn2);

   btn2.setOnClickListener(this);
  
   Drawable(findViewById(R.id.mainLayout));
 
  

  
  
  
  
  
  }
 
 
 
  @Override
  protected void onStart() {
 
   System.gc();
   super.onStart();
    }
 
  @Override
  protected void onStop() {
  

   finish();
  
   System.gc();
   super.onStop();
    }
 
 
  @Override
  protected void onResume() {
   finish();
   System.gc();
   super.onResume();
    }
 
 @Override
 protected void onDestroy() {
  finish();
  System.gc();
  super.onDestroy();
   }
  
 @Override
 protected void onPause() {
  finish();
  System.gc();
  super.onPause();
   }
   
 
   private void Drawable(View view) {
         if (view.getBackground() != null) {
         view.getBackground().setCallback(null);
         }
        
        
   }
  public void onClick(View v){
  switch (v.getId()) {
 
 
 case R.id.btn1:{
  Intent intent=new Intent(ana3.this,ana4.class);


  startActivity(intent);
  break;

 

 

 


    }
   case R.id.btn2:{
   Intent intent=new Intent(ana3.this,ana2.class);


  startActivity(intent);

  break;

 
       }}
 }
  public static boolean recycleBitmap(ImageView iv) {
  
   if (iv != null) {
    try {
    
     Drawable d = iv.getDrawable();
    
     iv.setImageBitmap(null);
    
     if (d instanceof BitmapDrawable) {
      Bitmap b = ((BitmapDrawable) d).getBitmap();
      b.recycle();
     }
     d.setCallback(null);
     }
     catch (Exception e) {
      e.getStackTrace();
      return false;
     }
    return true;
   }
   return false;
  }
  
   

}


================xml

<?xml version="1.0" encoding="utf-8"?>
  <ScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >
    
  <LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:adjustViewBounds="true"
    android:orientation="vertical"
    android:id="@+id/mainLayout">

  <ImageView
    android:id="@+id/image1"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:src="@drawable/a41"
    android:adjustViewBounds="true" />
 
   <LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:adjustViewBounds="true"
    android:orientation="horizontal"
    android:id="@+id/mainLayout">
   
  <Button
    android:id="@+id/btn2"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/b52btn"
    android:adjustViewBounds="true"
    android:layout_weight="1" />
 
    <Button
    android:id="@+id/btn1"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/b53btn"
    android:adjustViewBounds="true"
    android:layout_weight="1" />

    </LinearLayout>
   
  <ImageView
   android:id="@+id/image3"
   android:layout_width="fill_parent"
   android:layout_height="fill_parent"
   android:adjustViewBounds="true"
   android:src="@drawable/a44" />
 
    </LinearLayout>
    </ScrollView>