网上说在用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,暂存权宜之计,且待日后慢慢查出两全之法。
时间: 2024-11-05 11:45:57