重新启动Android应用程序后获取以前创建的背景色(用户输入)
嘿,我想改变我的应用程序的背景色,因为它在每次点击按钮时都会改变,但每当我重新启动它时,它就会重置为默认值,所以我如何才能改变它以保持不变重新启动Android应用程序后获取以前创建的背景色(用户输入),android,css,xml,eclipse,Android,Css,Xml,Eclipse,嘿,我想改变我的应用程序的背景色,因为它在每次点击按钮时都会改变,但每当我重新启动它时,它就会重置为默认值,所以我如何才能改变它以保持不变 final TextView txt = (TextView) findViewById(R.id.textView1); txt.setOnClickListener(new View.OnClickListener() { private int stateChanged=1; @Override
final TextView txt = (TextView) findViewById(R.id.textView1);
txt.setOnClickListener(new View.OnClickListener() {
private int stateChanged=1;
@Override
public void onClick(View v) {
if(stateChanged==1) {
txt.setBackgroundResource(R.drawable.pk);
} else if(stateChanged==2) {
txt.setBackgroundResource(R.drawable.jk);
} else if(stateChanged==3) {
txt.setBackgroundResource(R.drawable.sk);
} else{
txt.setBackgroundResource(R.drawable.style);
}
stateChanged++;
if(stateChanged==5){
stateChanged=1;
}
}
});
样式是我的默认背景,如何随背景更改状态栏颜色
处理API-17