Search code examples
androideclipsebuttoniconswifi

What to use for Android Icon indicators


I'm trying to make Icon indicators if Wifi is ON or OFF and the same for GSM but I don't know what's the best Form Widget to use ? toggle button,image view,image button ?? taking into consideration I want to apply conditions like if Wifi is connected display this image if it's not display the second image.So, I hope if you have an example or anything that would be helpful. Thanks


Solution

  • You can do something like this :

        if(isWifiConnected())
        {
             your_imageView.setBackgroundResource(R.drawable.img_wifiON);
        } 
        else 
        {
            your_imageView.setBackgroundResource(R.drawable.img_wifiOFF);
        }