• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

why i am getting ClassCastException

 
sam liya
Ranch Hand
Posts: 1243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Below is the part of activity class which getting exception



below is the Global class



Also i have already import the Global class in my Loginactivity activity.

below is the exception

 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You only get a ClassCastException for one reason: the Object you are casting is not an instance of the Class you are casting it to. Just because your Global class extends Application does not mean it will be the Application used to instantiate your app. What does your Manifest look like?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic