在我的主要活動中,當我點擊時,我有一個登錄按鈕,它改變了此按鈕的背景顏色並將我帶入SignIn活動。返回活動時清除背景行爲
// Button SignInActivity
final Button signIn = (Button) findViewById(R.id.btn_sign_in);
signIn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
signIn.setBackgroundColor(getResources().getColor(R.color.colorAccent));
Intent intent = new Intent(MainActivity.this, SignInActivity.class);
startActivity(intent);
}
});
我的問題是當我回到MainActivity時,我發現SignIn按鈕與colorAccent背景。 任何解決方案來清除背景顏色?
感謝它的工作) –
我的榮幸......請將我的回答標記爲已接受。快樂編碼! :) –
當然,完成! –