안녕하세요..
보시기 눈아프시겠지만..
제가 혼자 독학하면서 .. 해본것인데.. 제대로 된것이지 안된것이지 도통 알길이 없습니다..
제 소스 한번만 봐주시고 잘못된것좀 지적좀 부탁드립니다..
제가 정말 많이 힘듭니다..ㅠㅠ
public class RASOL1extends Activity implements OnClickListener {
@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.rasol1);
Button btn1 = (Button)findViewById(R.id.btn1);
btn1.setOnClickListener(this);
System.gc();
Button btn2 = (Button)findViewById(R.id.btn2);
btn2.setOnClickListener(this);
System.gc();
Drawable(findViewById(R.id.mainLayout));
System.gc();
}
private void Drawable(View view) {
if (view.getBackground() != null) {
view.getBackground().setCallback(null);
}
}
/** Width **/
public static int getBitmapOfWidth( String rasol1){
try {
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
BitmapFactory.decodeFile(rasol1, options);
return options.outWidth;
} catch(Exception e) {
return 0;
}
}
/** height **/
public static int getBitmapOfHeight(String rasol1){
try {
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
BitmapFactory.decodeFile(rasol1, options);
return options.outHeight;
} catch(Exception e) {
return 0;
}
}
public void onClick(View v){
if(v.getId()==R.id.btn1){
Intent intent=new Intent(this,rasol2.class);
startActivity(intent);
finish();
v = null;
intent = null;
System.gc();
}
else if(v.getId()==R.id.btn2){
Intent intent=new Intent(this,rasol22.class);
startActivity(intent);
finish();
v = null;
intent = null;
System.gc();
}
}
public static boolean recycleImageViewBitmap(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;
}
}




왜...이리 gc가 많나요..-_-;;
그리고..선언부 따로 모아서 메소드 만들고 이벤트부 따로 모아서 메소드 만들고 하면 참 보기 편하겠지요^^;;
그리구 생명주기에 따른 설정은 아주 없는건가요?? 앱이 조