0

My homepage has a imagebutton. When I click the imagebutton, imagebutton's Alpha will change to 150. But when I back to the previous page, the imagebutton will still show Alpha(150) Instead of the default Alpha. How can I do when I back the previous page, the imagebutton will show the default ?

** I change my imagebutton's Transparency in java
like this :

btn_route.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View arg0) {
            // TODO Auto-generated method stub
            btn_route.getBackground().setAlpha(150);

            Intent change_stationArea = new Intent();
            change_stationArea.setClass(MainActivity.this,
                    stationArea.class);

            startActivity(change_stationArea);
        }
    });
Jeff_Huang
  • 15
  • 4

1 Answers1

0

Add this to your activity/fragment and it should do the trick

 @Override
    protected void onResume()
    {
        super.onResume();
        btn_route.getBackground().setAlpha(255);
    }
Pedro Oliveira
  • 20,442
  • 8
  • 55
  • 82