CySmart Android App Exception Error

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
AsRa_264661
Level 4
Level 4
50 replies posted 25 replies posted 10 likes received

Hi All,

   

I had taken the CySmart example code, and started making my own application for BLE. I am getting some exception errors when adding this following

   

 application = (CySmartApplication) getActivity().getApplication();

   

 

   

in the profile scanning fragment.java file

   

 

   

Any idea on it?

   

error:

   

  Caused by: java.lang.ClassCastException: android.app.Application cannot be cast to com.fair.ashok.cypresssmart.CySmartApplication
    

   

Thanks,

   

Ashok r

0 Likes
1 Reply
Anonymous
Not applicable

Found this on the internet:

   

http://javarevisited.blogspot.in/2012/12/how-to-solve-javalangclasscastexception-java.html

   

Regards,

   

-Madhu Sudhan

0 Likes