Android学习过程中遇到的问题及解决方法

来源:互联网 发布:chrome程序员常用插件 编辑:程序博客网 时间:2024/05/07 14:51

1.问题:控制台出现emulator: ERROR: the user data image is used by another emulator. aborting提示

原因:没有正确关闭模拟器

解决:在进程中结束adb.exe,重启Eclipse即可。

2.问题:出现 emulator-5554 disconnected! Cancelling xxxxxx activity launch'!

解决:run里面有一个run configrations,在里面有一个选项每次运行都察掉记录 wipe out user data,选上该选项。.

3.问题:出现 sdl_app: emulator-arm.exe应用程序错误。

解决:网上有说关闭杀毒软件的,但关闭重启后还是出错。删除该AVD,新建。在新建的过程中Snapshot 下选择enable项。

4.问题:操作raw目录下数据库文件找不到在SD卡创建的路径。

 解决:没有添加访问权限。

5.问题:控制台报错:Re-installation failed due to different application signatures。

解决:重建AVD。
6.程序中文乱码,保存时出现错误:Some characters cannot be mapped using "GBK" character encoding.
解决:Eclipse ->Window -> Preferences -> General -> Content Types ->Text 在底部出现 'Default edcodng:',改成UTF-8,然后update.
 7.在非Activity类中使用getSystemService()方法时,应先得到context。如在自定义的View中得到传感器方法 应写为 mSensorManager = (SensorManager)context.getSystemService(Context.SENSOR_SERVICE);
以上解决方法来自互联网。 
原创粉丝点击