Monday, February 17, 2014

View xml into question



To imageButton add a listener, the listener is the xml file content to use LayoutInflater xml into View and then the error.


On Baidu for a long time, did not find the root of the problem is. Help! ! !

Error as follows:




Given the number of lines of code is: LayoutInflater inflater = LayoutInflater.from (context);


xml file:

android: layout_width = "fill_parent"
android: layout_height = "fill_parent">

android: id = "@ + id / im_gallery"
android: layout_width = "fill_parent"
android: layout_height = "110px"
android: layout_alignParentLeft = "true"
android: layout_marginTop = "10px"
>


android: id = "@ + id/image11"
android: layout_width = "90px"
android: layout_height = "90px"
android: layout_alignParentLeft = "true"
android: layout_marginBottom = "@ + id / im_gallery">




Xml personally feel is the problem. But the xml contents inside and no errors. . .

Seeking to explain<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:

11-16 16:24:18.985: W / dalvikvm (326): threadid = 1: thread exiting with uncaught exception (group = 0x40015560)
11-16 16:24:19.025: E / AndroidRuntime (326): FATAL EXCEPTION: main
11-16 16:24:19.025: E / AndroidRuntime (326): java.lang.UnsupportedOperationException: Can't convert to dimension: type = 0x12
11-16 16:24:19.025: E / AndroidRuntime (326): at android.content.res.TypedArray.getDimensionPixelSize (TypedArray.java: 463)
11-16 16:24:19.025: E / AndroidRuntime (326): at android.view.ViewGroup $ MarginLayoutParams . (ViewGroup.java: 3696)
11-16 16:24:19.025: E / AndroidRuntime (326): at android.widget.RelativeLayout $ LayoutParams (RelativeLayout.java: 1050).
11-16 16:24:19.025: E / AndroidRuntime (326): at android.widget.RelativeLayout.generateLayoutParams (RelativeLayout.java: 920)
11-16 16:24:19.025: E / AndroidRuntime (326): at android.widget.RelativeLayout.generateLayoutParams (RelativeLayout.java: 68)
11-16 16:24:19.025: E / AndroidRuntime (326): at android.view.LayoutInflater.rInflate (LayoutInflater.java: 625)
11-16 16:24:19.025: E / AndroidRuntime (326): at android.view.LayoutInflater.inflate (LayoutInflater.java: 408)
11-16 16:24:19.025: E / AndroidRuntime (326): at android.view.LayoutInflater.inflate (LayoutInflater.java: 320)
11-16 16:24:19.025: E / AndroidRuntime (326): at android.view.LayoutInflater.inflate (LayoutInflater.java: 276)
11-16 16:24:19.025: E / AndroidRuntime (326): at com.example.telephone.MainActivity.dialog (MainActivity.java: 36)
11-16 16:24:19.025: E / AndroidRuntime (326): at com.example.telephone.MainActivity $ 1.onClick (MainActivity.java: 27)


Error code

No comments:

Post a Comment