android - ERROR No package identifier when getting value for resource number -
Both activities are in one package
Other activity uses another layout file
setContentView (R.layout.main2);
Errors on this line in the second row.
Lesson 1 of the Edit Text (= Edit Text) FindBUID (RIDAditet 03);
There is a layout file for the second_activative.
& lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; LinearLayout xmlns: Android = "http://schemas.android.com/apk/res/android" Android: layout_width = "fill_parent" Android: layout_height = "fill_parent" android: orientation = "vertical" & gt; & Lt; LinearLayout Android: id = "@ + id / linearLayout01" Android: layout_width = "wrap_content" Android: layout_height = "wrap_content" & gt; & Lt; TextView Android: id = "@ + id / textView01" Android: layout_width = "wrap_content" Android: layout_height = "wrap_content" android: text = "the answer is:" & gt; & Lt; / TextView & gt; & Lt; EditText Android: id = "@ + id / EditText03" Android: layout_width = "wrap_content" Android: layout_height = "wrap_content" & gt; & Lt; / EditText> & Lt; / LinearLayout & gt; & Lt; Android: id = "@ + id / Button01" Android: layout_width = "wrap_content" Android: layout_height = "wrap_content" Android: onClick = "onClick" Android: Text = & "Calling an Intent"; & Lt; / Button & gt; & Lt; / LinearLayout & gt;
There are errors in the logkat window
08-01 19: 32: 20.340: warning / resource type (8875): when a package identifier is received Value for resource number 0x00000005 08-01 19: 32: 20.390: Error / AndroidRuntime (8875): android.content.res.Resources $ NotFoundException: String Resource ID # 0x5
< P> mail.xml
& lt; TextView Android: id = "@ + id / TextView01" Android: layout_width = "wrap_content" Android: Layout_height = "wrap_content" Android: text = "first number:" & gt; & Lt; / TextView & gt; & Lt; EditText Android: id = "@ + id / editText01" Android: inputType = "number" Android: layout_width = "wrap_content" Android: layout_height = "wrap_content" & gt; & Lt; / EditText> Android: text = "id =" @ + id / textView02 "Android: layout_width =" wrap_content "android:
: Layout_height = "wrap_content" Android: text = "second number:" & gt; & gt; TextView & gt; EditText Android: id = "@ + id / EditText02" Android: inputType = "number" Android: Layout_width = "wrap_content" android: layout_height = "wrap_content">
Second screen .xml
TextView Android: id = "@ + id / TextView03" Android: Layout_width = "wrap_content" android: layout_height = "wrap_content" android: text = "answer:" & gt; & lt; / TextView & gt; EditText Android: id = "@ + id / main2EditText01" Android: inputType = "number" Android: layout_width = "wrap_content" Android: layout_height = "wrap_content"> ;
P> manifest xml file
& lt; Activity Android: "ActivityTwo" name = />
I got The same error message when I tried to use TextView.setText to pass a character instead of Strong This makes sense because the four things will be promoted in an integer, which means that I actually
< Pre> was calling TextView.setText (int resId);
And because there was no resource with that value, it would not work.
Comments
Post a Comment