我已经为 android 4.0 及更高版本创建了一个应用程序。我的应用程序几乎在所有阶段都使用互联网。在每一项活动中,我都完成了所有必要的处理,以在与服务器通信之前检查互联网连接。
我面临的问题是,如果在 2G 或 3G 网络上使用该应用程序运行良好,但如果在安全 wifi 连接中使用它会崩溃。我尝试在不安全的 wifi 网络中使用该应用程序,它运行良好。
应用程序的清单文件:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ica.bankpoexamination2"
android:versionCode="1"
android:versionName="1.0" >
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" >
</uses-permission>
<uses-permission android:name="android.permission.INTERNET" >
</uses-permission>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" >
</uses-permission>
<uses-permission android:name="android.permission.READ_PHONE_STATE" >
</uses-permission>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
<uses-sdk android:minSdkVersion="10" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name="com.ica.bankpoexamination2.SplashScreenActivity"
android:label="@string/app_name"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.ica.bankpoexamination2.LoginActivity"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.ica.bankpoexamination2.TakeTestActivity"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.ica.bankpoexamination2.PracticeTestActivity"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.ica.bankpoexamination2.SpeedTestActivity"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.ica.bankpoexamination2.ExamActivity"
android:label="@string/app_name"
android:screenOrientation="landscape" >
</activity>
<activity
android:name="com.ica.bankpoexamination2.GeneralInstructionsActivity"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.ica.bankpoexamination2.RateUsActivity"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.ica.bankpoexamination2.SpeedTestExamDetailsActivity"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.ica.bankpoexamination2.PracticeTestExamDetailsActivity"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.ica.bankpoexamination2.ChooseTestTypeActivity"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.ica.bankpoexamination2.ExamNamesActivity"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.ica.bankpoexamination2.ReportActivity"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.ica.bankpoexamination2.CurrentUpdateActivity"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.ica.bankpoexamination2.TipsAndTricksActivity"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.ica.bankpoexamination2.LibraryActivity"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.ica.reportinnactivities.ReportListActivity"
android:label="@string/app_name"
android:screenOrientation="landscape" >
</activity>
<activity
android:name="com.ica.reportinnactivities.ReportDetailsActivity"
android:label="@string/app_name"
android:screenOrientation="landscape" >
</activity>
<activity
android:name="com.ica.reportinnactivities.ReportScoreCardActivity"
android:label="@string/app_name"
android:screenOrientation="landscape" >
</activity>
<activity
android:name="com.ica.reportinnactivities.ReportTimeManagementActivity"
android:label="@string/app_name"
android:screenOrientation="landscape" >
</activity>
<activity
android:name="com.ica.reportinnactivities.ReportQuestionReportActivity"
android:label="@string/app_name"
android:screenOrientation="landscape" >
</activity>
<activity
android:name="com.ica.reportinnactivities.ReportDifficultyLevelActivity"
android:label="@string/app_name"
android:screenOrientation="landscape" >
</activity>
<activity
android:name="com.ica.reportinnactivities.ReportAllTestReportActivity"
android:label="@string/app_name"
android:screenOrientation="landscape" >
</activity>
<activity
android:name="com.ica.userregistration.RegisterActivity"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.ica.userregistration.OtpRegisterActivity"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.ica.currentupdate.CurrentUpdateDetailsActivity"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
</application>
</manifest>
我应该怎么做才能解决这个问题?
PS:其他应用程序在同一个安全 wifi 网络上运行良好。