7

Could not find class 'com.example.adapter.MyCursorAdapter' referenced from metho...

 4 years ago
source link: https://blog.csdn.net/dmk877/article/details/44984039
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Could not find class 'com.example.adapter.MyCursorAdapter' referenced from method com.example..

original.png
奋斗之路 2015-04-10 20:09:49 articleReadEyes.png 1185

今天看support.v4包下面的CursorAdapter的源码时做了如下操作导致了此异常如下图所示

Center
1.由于Android开发中每当新建一个项目的时候系统会自带android-support-v4.jar包,所以它就认为这个jar包和系统是一起的所以看其中的源码时找不到,这时候就需要把它移除掉
我做了如下的Remove操作
Center
2.手动的Add to Build Path(我做了如下的Add to Build Path操作)
Center
做了这两步之后就可以看support v4包下面的源码了,但是运行时报了错误Could not find class 'com.example.adapter.MyCursorAdapter' referenced from method com.example..
原因是我们手动导入v4包后在Order and Export中并没有选中它, 当我们用到此包下的类时就会崩溃
Center
解决办法:把上图的v4包前面的对勾打上,就ok了

Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK