网上说在用clipboardmanager的时候导包如下:
API 11之前:android.text.ClipboardManager-->1
API 11之后:android.content.ClipboardManager-->2
无论只导入包1,只导入包2还是一起都导入,都会出现如下问题
编译没错误,运行时按哪个按钮都会出现下面的对话框
Sorry!The process android.process.acore has stopped unexpectedly.Please try again.
然后看eclipse会有下面一连串大问题
logcat:
Could not find class ‘android.content.ClipboardManager‘, referenced from method com.example.testcopy.MainActivity.copyFromResourceText
Could not find method blahblah
VFY: dead code xxxxx in xxxxx/MainAcitivity;,xxx(method)
......
解决方法:把AndroidManifest.xml里的android:minSdkVersion改成11,暂存权宜之计,且待日后慢慢查出两全之法。
本文出自 “Chronosphere” 博客,转载请与作者联系!
原文地址:http://chronosphere.blog.51cto.com/9598252/1605796