问题:java.lang.ClassCastException: android.app.Application cannot be cast to utils.ClientApp
解决方法:在AndroidManifest.xml 加
android:name="utils.ClientApp"
<application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:name="utils.ClientApp" android:supportsRtl="true" android:theme="@style/AppTheme"> <activity android:name=".UserLoginActivity"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> <activity android:name=".MainActivity"> </activity> </application>