액티비티 1에서 버튼을 두고 액티비티2에 버튼이미지를 변경하고 저장하려고합니다.
액티비티1 코드는
mClear.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent intent = new Intent(Place_Gyeongbok_Gyeonghoeru.this,
Choice_Acourse_Activity.class);
SharedPreferences.Editor editor = setting.edit();
editor.putInt("Gyeonghoe", R.drawable.ic_launcher);
startActivity(intent);
}
});
이고 버튼을 누르면 프리퍼런스에 Gyeonghoe 키 값으로 이미지를 저장을한상태로 액티비티2를 실행하고
액티비티2 코드는
pic=setting.getInt("Gyeonghoe", R.drawable.left);
if(pic == R.drawable.left){
mGyeonghoe.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.left, 0, 0);
mGyeonghoe.setBackgroundColor(Color.alpha(0));
}else{
mGyeonghoe.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.ic_launcher, 0, 0);
mGyeonghoe.setBackgroundColor(Color.alpha(0));
}
이렇게 pic에 받아놓고 쓰려고 하는데 액티비티 버튼이미지 변화가 일어나질 않네요;;
어떻게해야할까요..