Pages

Thursday, June 26, 2014

不必二選一

多了寄託,多了方向,長年來的空缺開始注入活水,即便那只是道娟娟細流,即使這一切極大可能只是虛幻;即便我知道那其實是這一路上所遇過的人的幫助與體諒,以及我每次都敗得非常難看,但卻總是屢敗屢戰所開闢出來的渠道,心中仍是感謝。好一陣子沒有這麼輕鬆的感覺了,雖然日後我可能沒辦法從這字裡行間確切體會出我現在的心靈狀態;但我認為,我能藉由記錄強化我當下的感受,就活在當下吧!


這種感覺是眉目俱笑、是怡然自得、是悠然自得不患得患失(好啦!偶而還是會有),是開心卻不是狂喜、是掛念卻不是踮念、有份量卻如清風一般不留痕跡,渴望坦承也贊成神祕。我真的很享受這種感覺,如果你們發現了什麼,能不能當做不知道,給我點空間呢?

其實在我第一次意會到的時候,我是很排斥的;我很怕會因為這樣而分心,甚至產生牽掛使得我未來的路出了差錯,我不想要有任何變數發生,我放不開。只是,我突然發覺到這種想法真的很幼稚,誰說念書和交朋友一定是會互相排斥的呢?就算會,現在說這也太找了吧!我在擔心什麼阿?這種想太多的心態才是真的會讓我兩者皆空停滯不前的毒瘤,我應該要放輕鬆、讓一切順其自然發展就好,不管會有怎樣的結局,不要讓自己後悔就好。


只願接下來的日子裡,一切隨緣、正常、自在。

大道不移,兩不捨。

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!

[Android] Missing AppTheme (styles)

Although I use git to include most of the resources and libraries for deploying my Android project, sometimes I get stuck when importing my own project among different machines, even in the same OS.

There is a typical one:
in your res/values/styles.xml

error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.




It is because I did not include a library appcompat_vXXX correctly.  The fastest way to include it, though locally (you have to do it once on every machine), is load an suitable appcompat_vXXX project on your machine.


Right click on your project -> Properties -> Android -> (scroll down) Library



Then you will see an item X ../appcompat_vXXX in the window.  All we have to do is click the 'Add...' button to select one of them (in my case: appcompat_v7_4), and click 'Apply' and 'OK'.




If there no any appcompat_XXX available, then you have to download them via Android SDK Manager and download 'Android Support Library' first.


You can see more details in
http://developer.android.com/tools/support-library/index.html