Imps are always mischievous, uncontrollable, only obedient to somebody special, and not as powerful as the real demons, yet.
小惡魔:調皮難控制的猴小孩,還在努力成為真正的大惡魔中。
As the title suggests, this is my everything notebook, may in traditional Chinese or English.
這裡什麼都寫,不管是食譜、遊記、練習寫作的爛文,抑或是個人的一些狗屁倒灶的東西都有可能出現,使用語言也是隨性。
*Sometimes, those bilingual articles are not formed by translation, I will represent the concepts twice using different ways of thinking based on the language I use.
Tuesday, June 24, 2014
[Android] Error inflating class fragment
We have a project that will contain several fragments in one activity, we compile and deploy it to a device without any error message. However, runtime exception occurs when we launch the App, even though we just declare a fragment and not use it yet.
At the first glance, I would consider that it is caused by the fragment class. But it is actually caused by the XML syntax while declaring the fragment component in the layout file of my main activity. See the rectangular area
android.view.InflateException: Binary XML file line #25: Error inflating class fragment
What happened?
It is due to the line 27 in the editor, which uses capital characters (even though it is exactly the same with the real java file we are going to use). All I need to do it change them with all lower characters (it is legal to use capital ones in the rear). That is to say, we revise it as
android:name="com.example.soundclassifier2.MusicFragment"
And everything works now!
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment