インターネットの像を確認した後、イメージビューの画像を変更したい。基本的に、インターネットが機能しているかどうかを確認したい特定の画像を表示したい。
ここに私のコード:
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);
}
}