学习一定有方法,有经验,有动力,有悟性,还要总结。


(一)

想在eclipse下导入一个android工程,这个工程已经存在了,总是提示invalid project description。其实是方法错了,这是解决问题的方法:


I have struggled with this issue myself for a while and I think the reason it happens is because (for Android) there are two ways to import projects into the workspace

1) import>General>Existing Project into Workspace
2) import>Android>Existing Code into Workspace

The errors described here are related to method 2).

For method 1) there will be no overlap problems as long as you uncheck the "Copy Projects into Workspace" box if the project is already in the workspace.


(二)

http://docs.since2006.com/android/2.1-drawables.php 使用android系统下的图标资源@android:drawable/editbox_background(editbox_background是安卓操作系统的图片)


(三)

Adding imports solved the problem for me.
And I found out that actually in Eclipse they can be imported automatically:

"Tip: After you have pasted sample code into an Eclipse project, press Ctrl (or Cmd) + Shift + O to import the required packages"

Hope this refresh what have been missed.

其实在用eclipse编写代码的时候,缺省的包可以通过按ctrl+shift+O导入。


(四)

byte[ ] 转换为 string


String str = new String(bytes, "UTF-8");
如果系统默认file.encoding.system是utf-8的可以省略后面的参数,直接写成


String str = new String(bytes);

也可以如下:

String str = IOUtils.toString(inputStream, "UTF-8");
这样呢:

byte[] byteArray = new byte[] {87, 79, 87, 46, 46, 46}; String value = new String(byteArray, "UTF-8");

更多相关文章

  1. 浅谈Java中Collections.sort对List排序的两种方法
  2. Python list sort方法的具体使用
  3. python list.sort()根据多个关键字排序的方法实现
  4. Android退出程序的多种方法
  5. 编程回忆之Android回忆(Android的强制横屏,竖屏,长亮)
  6. JS判断终端类型的几种方法
  7. android 使用Intent传递对象 Serializable 或者 Parcelabel 《第
  8. 关于新版SDK报错You need to use a Theme.AppCompat theme的两种
  9. Android非UI线程访问UI线程的方法总结

随机推荐

  1. android ADB (1) 键盘之adb keycode值
  2. Android 使用 AudioManager 类控制音量
  3. Android DrawerLayout和NavigationView
  4. Android自动化工具Monkeyrunner使用(三)
  5. 使用ant自动化构建android项目
  6. Android:创建网格状的RadioGroup
  7. android linux 系统总结5
  8. Google Map Android API V2中API Key的生
  9. Android Studio实用插件集合
  10. Android动态设置主题样式