开发者

Global Variable with extended Application Class

I used this but when i set the variable im getting an error: 03-28 09:01:36.492: WARN/System.err(706): java.lang.ClassCastException: android.app.Application What is this? I added the <applic开发者_如何学Goation android:name="MyApplication" android:icon="@drawable/icon" android:label="@string/app_name"> after i close the . If i do it before the close its also not working.

EDIT: Okay it was because i have two times Application. Now i added it to the Application which was created by eclipse but it wants now permissions?!

EDIT2: Got it!


I believe the problem due to duplicate Application file is not solved completely. Remove the file from the project completely. Then go to manifest file, Application Tab. Confirm that the Name field is empty. Add the name of your application file there and click on the link. This will create the application file again. Hope this helps.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜