2. is not translated in
Eclipse > Preference > Android > Lint Error Checking的Correctness: Messages > MissingTranslate
将 Severity 从 Fetal 改为 Warming
1.cannot be resolved or is not a field
R.layout.main总是在layout提示错误。clean一下工程或者fix project properties 还是解决不了
原因可能是添加文件,比如xml文件或者资源文件时,系统自动添加了import android.R;
android.R是系统提供的资源,R是应用程序的资源。这时候只要删除 import android.R;这条语句就可以了。
2. 关联library
选中项目右键--->properties--->android--->修改library指引
3.库的引用 project.properties
android.library.reference.1=../library
4.下载SDK时,Read timed out Done. Nothing was installed.
Start the SDK manager as Administrator 或设置Tools--->options
.
5. Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag.
6.Don't dump hprof file because it is not in monkey test
7.java.lang.IllegalMonitorStateException: object not locked by thread before wait()
二。
1.unbound prefix
明明是从网上down来的代码,copy上去了却报错,而且提示unbound prefix。
解决:删除重新写。自己也不知道哪儿出了错。
2.No resource identifier found for attribute 'source' in package 'android'
android:resource 写成了android:source
3.Attribute is missing the Android namespace prefix
前面少写了双引号,后面报错
4.Class requires API level 3 (current min is 1)
Right click on the project folder > Android tools > Clear Link Markers
5.IntentService测试 出错 newInstance failed: no <init>()
public class MyIntentService extends IntentService { private static final String TAG_STRING = "MyIntentService"; public MyIntentService(String name) { //其实IntentService的name参数用于: Used to name the worker thread, important only for debugging. super(name); } @Override protected void onHandleIntent(Intent intent) { Log.v(TAG_STRING,"onHandleIntent sleep for 20 seconds"); Log.v(TAG_STRING, "onHandleIntent--Thread id : "+Thread.currentThread().getId()); try { Thread.sleep(20000); } catch (InterruptedException e) { e.printStackTrace(); } } }
修改为:
public MyIntentService() { super(TAG_STRING); }