第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Android檢查互聯(lián)網(wǎng)連接

Android檢查互聯(lián)網(wǎng)連接

藍山帝景 2019-06-23 16:38:01
Android檢查互聯(lián)網(wǎng)連接我想要創(chuàng)建一個使用互聯(lián)網(wǎng)的應(yīng)用程序,我正在嘗試創(chuàng)建一個函數(shù)來檢查連接是否可用,如果沒有,請轉(zhuǎn)到一個有重試按鈕和說明的活動。到目前為止,附加的代碼是我的代碼,但是我得到了錯誤Syntax error, insert "}" to complete MethodBody.我一直在努力讓它發(fā)揮作用,但到目前為止沒有運氣.任何幫助都將不勝感激。public class TheEvoStikLeagueActivity extends Activity {     private final int SPLASH_DISPLAY_LENGHT = 3000;     /** Called when the activity is first created. */     @Override     public void onCreate(Bundle icicle) {         super.onCreate(icicle);         setContentView(R.layout.main);         private boolean checkInternetConnection() {             ConnectivityManager conMgr = (ConnectivityManager) getSystemService (Context.CONNECTIVITY_SERVICE);             // ARE WE CONNECTED TO THE NET             if (conMgr.getActiveNetworkInfo() != null                     && conMgr.getActiveNetworkInfo().isAvailable()                     && conMgr.getActiveNetworkInfo().isConnected()) {                 return true;                 /* New Handler to start the Menu-Activity                  * and close this Splash-Screen after some seconds.*/                 new Handler().postDelayed(new Runnable() {                     public void run() {                         /* Create an Intent that will start the Menu-Activity. */                         Intent mainIntent = new Intent(TheEvoStikLeagueActivity.this, IntroActivity.class);                         TheEvoStikLeagueActivity.this.startActivity(mainIntent);                         TheEvoStikLeagueActivity.this.finish();                     }                 }, SPLASH_DISPLAY_LENGHT);             } else {                 return false;                 Intent connectionIntent = new Intent(TheEvoStikLeagueActivity.this, HomeActivity.class);                 TheEvoStikLeagueActivity.this.startActivity(connectionIntent);                 TheEvoStikLeagueActivity.this.finish();             }         }     }
查看完整描述

3 回答

  • 3 回答
  • 0 關(guān)注
  • 466 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號