I have a custom in activity in the inner class inherits GridView in xml always wrong when in use, online method seems not work very well, who can give me a favor?<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply: Hair error, send the code, so ask, how to see it? Estimate is the problem of your initialization function
Reply: cited a floor reply: hair wrong, send the code, so ask how you see it is estimated that the problem of the initialization function android.view.InflateException: Binary XML file line # 19: Error inflating class com.sztech.videoplayer.VideoPlayerActivity.view.MyGrid at android.view.LayoutInflater.createViewFromTag (LayoutInflater.java: 581) at android.view.KeyEvent.dispatch (KeyEvent.java: 1289) at android.app.Activity.dispatchKeyEvent (Activity.java: 2078) at com.android.internal.policy.impl.PhoneWindow $ DecorView.dispatchKeyEvent (PhoneWindow.java: 1663) at android.view.ViewRoot.deliverKeyEventToViewHierarchy (ViewRoot.java: 2562) at android.view.ViewRoot.handleFinishedEvent (ViewRoot.java: 2537) at com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run (ZygoteInit.java: 839) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java: 597) at dalvik.system.NativeStart.main (Native Method) Caused by: java.lang.ClassNotFoundException: com.sztech.videoplayer.VideoPlayerActivity.view.MyGrid in loader dalvik.system.PathClassLoader [/ data/app/com.sztech.videoplayer-2.apk] at dalvik.system.PathClassLoader.findClass (PathClassLoader.java: 240) at java.lang.ClassLoader.loadClass (ClassLoader.java: 551) at java.lang.ClassLoader.loadClass (ClassLoader.java: 511) at android.view.LayoutInflater.createView (LayoutInflater.java: 471) at android.view.LayoutInflater.createViewFromTag (LayoutInflater.java: 570) Reply: com.sztech.videoplayer.VideoPlayerActivity.view.MyGrid This class does not exist! Reply: xml in the configuration xmlns: myapp = "http://schemas.android.com/apk/res/com.szectech.videoplayer.view" xmlns: tools = "http://schemas.android.com/tools" android: layout_width = "match_parent" android: layout_height = "match_parent"> android: id = "@ + id / grid" android: layout_width = "fill_parent" android: layout_height = "wrap_content" android: columnWidth = "85dp" android: verticalSpacing = "5dp" android: horizontalSpacing = "1dp" android: numColumns = "8" android: background = "@ android: color / darker_gray" /> Reply: com.szectech.videoplayer.VideoPlayerActivity.view.MyGrid There is no com.szectech.videoplayer.VideoPlayerActivity.view this package So, in this package there MyGrid.java this document? Reply: reference to the third floor of the reply: com.sztech.videoplayer.VideoPlayerActivity.view.MyGrid This class does not exist! That MyGrid is my inner classes, I do not know how to configure, so with a look online, it is estimated it does, xml it can not find. How to make xml configuration find my inner work? Reply: Xml code if you copy directly from the Internet, but no local com.szectech.videoplayer.VideoPlayerActivity.view.MyGrid this class, definitely the wrong one. Reply: references, 5th Floor reply: com.szectech.videoplayer.VideoPlayerActivity.view.MyGrid There is no com.szectech.videoplayer.VideoPlayerActivity.view this package So, in this package there MyGrid.java this document? com.szectech.videoplayer this package there, VideoPlayerActivity This is a package under my activity, MyGrid is that inner classes. Reply: reference to the 7th floor of replies: xml code if you copy directly from the Internet, but no local com.szectech.videoplayer.VideoPlayerActivity.view.MyGrid This class is definitely the wrong one. xml not online copy, I just added according to him. view.MyGrid Reply: You put MyGrid ended up outside the class, which is to have MyGrid.java this file. Reply: reference to the 10th floor of the reply: you MyGrid ended up outside the class, which is to have MyGrid.java this file. xml file is not referenced inside the class do? Reply: I suggest you first achieve a detection method is correct, and then transplanted into the right inner class with the outer class. Reply: reference to the 12th floor of the reply: suggest you to achieve a detection method is correct, and then transplanted into the right inner class with the outer class. That MyGrid originally written outside class, you can, and what methods are right. Now use the data in an activity, turning it into an internal class, now I just do not know how to use the xml inside an inner class. Reply: reference to the 12th floor of the reply: suggest you to achieve a detection method is correct, and then transplanted into the right inner class with the outer class. Xml error is an internal class that can not be found, how can I configure it, let it find? Reply: To be declared as static inner classes Reply: com.szectech.videoplayer.VideoPlayerActivity.view $ MyGrid Referenced method inside class Reply: reference to the 16th floor of the reply: com.szectech.videoplayer.VideoPlayerActivity.view $ MyGrid Cited method inner classes Arranged android: id = "@ + id / grid" android: layout_width = "fill_parent" android: layout_height = "wrap_content" android: columnWidth = "85dp" android: verticalSpacing = "5dp" android: horizontalSpacing = "1dp" android: numColumns = "8" android: background = "@ android: color / darker_gray" /> Prompts Element type "com.szectech.videoplayer.VideoPlayerActivity.view" must be followed by either attribute specifications, ">" or "/>". But behind MyGrid plus />, still prompt. Reply: reference to the 15th floor Reply: inner class to be declared as static Non-static inner classes can not be referenced? Reply: reference to the 18th floor Reply: reference to the 15th floor Replies: Internal class should be declared as static Non-static inner classes can not be referenced? Only static class or method can be referenced externally. Reply: Since the need is static class, and you say you want to use this class to Activity data also needs to be called a static object, if this object is defined in the Activity inside, that you give it, not because Activity defined as Static's. Reply: That should be the wording of the controls, get hold of a separate document it, but also to other people to use. Transplantation is also convenient
No comments:
Post a Comment