i want to change a imageview image after i check the Internet statues.
basic, i want to check if the Internet works if it does i want to show a certain image.
here my code:
public void onClick(View v) {
// get Internet status
isInternetPresent = cd.isConnectingToInternet();
// check for Internet status
if (isInternetPresent) {
// Internet Connection is Present
// make HTTP requests
showAlertDialog(AndroidDetectInternetConnectionActivity.this, "Internet Connection", "You have internet connection", true);
} else {
// Internet connection is not present
// Ask user to connect to Internet
showAlertDialog(AndroidDetectInternetConnectionActivity.this, "No Internet Connection", "You don't have internet connection.", false);
}
}
i am assume that you have knowledge of checking internet in Android.
in oncreate use this:
onbutton click: