Error recording of Android notes

Source: Internet
Author: User

Preface-A good memory is not as bad as writing, recording the Android learning process encountered a variety of problem bugs. O (∩_∩) o

Error

caused by:android.content.res.resources$notfoundexception:string resource ID #0x0

The reason for the error--usually the int data is assigned to a string, and then the TextView display will appear as above error.

workaround -- use string.valueof or add "" after int data

Fatal error 2--

In the layout file, the text is set using the following syntax: hardcoded string "Next", should use @string resource[HTML]View Plaincopy
  1. < Button   
  2. Android:id = "@+id/button1"   
  3. Android:layout_width = "118DP"    
  4. Android:layout_height = "Wrap_content"   
  5. Android:text = "Next" />"
Although it can work, but there will be a warning, after all, this is not a good habit.

Solution-- should be set in Res/values/strings.xml:

[HTML]View Plaincopy
  1. <? XML version="1.0" encoding="Utf-8" ?>   
  2. < Resources ; &NBSP;&NBSP;
  3.      < String &NBSP; name = "message" ; next </ String ; &NBSP;&NBSP;
  4. </ Resources >   
use when referencing
android:text="@string/message"
on the line. This can be done to change the whole change, in support of multiple languages is also very useful. In addition, the setting of the color is preferably similar to the setting in COLOR.XM.

Fatal error 3--

The following error occurred while opening the lower version of the project [2013-12-13 17:39:11-serialdemo] Unable to resolve target ' android-10 '
Workaround--In the Project.Properties file to change the 10 to be used in the relatively new is not. Currently 15 is available, up to 19.


Fatal error 4--

API Level One (current min is 8): New Android.widget.SimpleCursorAdapte

Workaround--

Right-click on the project->android tools->clear Link markers. You can temporarily resolve it, but if the emulator used for debugging is a low version, then there is this error after debugging.

It would be fine if you changed the USER-SDK android:minsdkversion in the manifest file to the high version of the error. such as the following:

<uses-sdk

android:minsdkversion= "11"//before this is 8

Android:targetsdkversion= "/>"

Fatal error 5--

Problem: DescriptionResource Pathlocation Type

unparsed AAPT error (s)! Check the console for output. bundle_test Line 1 Android ADT problem

Workaround--

The layout file name can only be selected in lowercase 26 letters and number 0~9. As a result, there are uppercase letters in our filenames that will cause an error.

The reason for this is that I created an XML file named Receiver.xml

So it would be nice to change the name to lowercase.

Fatal error 6--

08-16 09:06:45.018:W/DALVIKVM (2286): vfy:unable To resolve static method 3273:lorg/slf4j/loggerfactory;. GetLogger (ljava/lang/class;) Lorg/slf4j/logger;
08-16 09:44:13.617:W/DALVIKVM (4731): vfy:unable To resolve static method 2649:lcom/nostra13/universalimageloader/core /imageloader;. GetInstance () Lcom/nostra13/universalimageloader/core/imageloader;

Threadid=1:thread exiting with uncaught exception (group=0x4001d800)

Workaround--

Buildpath->order and Export->select All

Fatal error 7--

[2014-01-07 17:32:50-dex Loader] Unable to execute dex:java.nio.BufferOverflowException. Check the Eclipse log for stack trace. [2014-01-07 17:32:50-beian] Conversion to Dalvik format failed:unable to execute dex:java.nio.BufferOverflowException. Check the Eclipse log for stack trace. Workaround--

Click the Project right button to open build path, configure Bulid path, remove this dependencies dependency package generated by loading the outside project. Just fine.!!!

Fatal error 8--

Java.lang.IllegalStateException:attempt to re-open an already-closed object problem reason--

Because I called another database query method in a database query method, my database query method is to get the Sqlitedatabase object at the beginning, close the Sqlitedabse object at the end, Results of the Internal database query method at the end of the direct shutdown of the Sqlitedatabase object, resulting in an error outside the database query operation, here you do not think that more than a few sqlitedatabase objects can be, Each thread can use only one sqliteopenhelper, which makes it possible for each thread to use a Sqlitedatabase object (the multithreaded operation database will error);

Solutions --I no longer close the Sqlitedatbase object of the Internal database query method or integrate that method directly into the query method outside, of course, to ensure that this query method only appears in other database query methods, if you use this method alone, On the contrary, because the Sqlitedatabase object is not closed and error ;

Fatal error 9--

Description Resource Path Location typethe type Java.lang.Object cannot is resolved. It is indirectly referenced from required. class files Welcomeactivity.java/babybaycar/src/com/example/babybay Line 1 Jav A problem


Solution--

Open Eclipse good works and suddenly the above error occurs. The problem arises because you may have two workplace, but one of you suddenly deleted it, and Eclipse did not find it, so we reported the above error. The workaround is to switch to another workplace, and then restart Eclipse, file-workplace conversion.

Fatal error 10--

When a CheckBox or button is used in the ListView, clicking on the subkey will not respond, as follows: By default, these child controls have a spot focus, and the ListView item can be selected based on its ability to capture focus, so We can set the Focusable property of all controls contained in the item in the ListView to False so that the ListView item automatically gets the focus's permission, and it can be selected. It also responds to the Onitemclick () method in Onitemclicklistener.

Solution--There are two kinds:Method One: Set the Focusable property of all child controls in the ListView's List_item to False 2. Set the List_item root control to the property android:descendantfocusability= " Blocksdescendants "List_item shields all child controls from getting focus focused and does not require that each control in List_item be set focusable property to legal color

PostScript--Sorry, write a bit messy, these are my debugging time encountered problems, part of the problem is to refer to the solution of the netizen.



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.