<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by JerryLin on Medium]]></title>
        <description><![CDATA[Stories by JerryLin on Medium]]></description>
        <link>https://medium.com/@jerrylinjf?source=rss-56e36a7cb3ba------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*3cO7E8Yf7B1oF1L6Huz2Iw.jpeg</url>
            <title>Stories by JerryLin on Medium</title>
            <link>https://medium.com/@jerrylinjf?source=rss-56e36a7cb3ba------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 22:27:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jerrylinjf/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Make a single choice (radio button) alert dialog]]></title>
            <link>https://medium.com/@jerrylinjf/make-a-single-choice-radio-button-alert-dialog-dd53805a481f?source=rss-56e36a7cb3ba------2</link>
            <guid isPermaLink="false">https://medium.com/p/dd53805a481f</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[dialog]]></category>
            <dc:creator><![CDATA[JerryLin]]></dc:creator>
            <pubDate>Sun, 30 Sep 2018 11:40:05 GMT</pubDate>
            <atom:updated>2018-09-30T16:45:48.535Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DNUCmFJNdLO-PyY5o0qh9A.png" /></figure><ol><li>create XML layout for the list item</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1ef79ef4a70b77faf01434e4cb902a40/href">https://medium.com/media/1ef79ef4a70b77faf01434e4cb902a40/href</a></iframe><p>2. create the adapter and add list item layout</p><p>3. create alert dialog then setSingleChoiceItems</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b7d6830ed1bc124f34d9282d51e4afdf/href">https://medium.com/media/b7d6830ed1bc124f34d9282d51e4afdf/href</a></iframe><p><a href="https://github.com/jerrylin-jf/SingleChoiceAlertDialog">jerrylin-jf/SingleChoiceAlertDialog</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd53805a481f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Use ViewPager without Fragment]]></title>
            <link>https://medium.com/@jerrylinjf/use-viewpager-without-fragment-906e3643fec3?source=rss-56e36a7cb3ba------2</link>
            <guid isPermaLink="false">https://medium.com/p/906e3643fec3</guid>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[JerryLin]]></dc:creator>
            <pubDate>Fri, 23 Feb 2018 11:25:27 GMT</pubDate>
            <atom:updated>2018-06-30T11:21:46.928Z</atom:updated>
            <content:encoded><![CDATA[<h3>Set layout</h3><p>add ViewPager to your XML layout for activity or fragment.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/48eb084e03854ddb75367d49d957c3e6/href">https://medium.com/media/48eb084e03854ddb75367d49d957c3e6/href</a></iframe><h3>Create PagerAdapter</h3><p>create ViewPagerAdapter that extend PagerAdapter.</p><p>set layout at instantiateItem function</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e2ba4cfa74bd34d6966b0f920b888ca8/href">https://medium.com/media/e2ba4cfa74bd34d6966b0f920b888ca8/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2ae8c08366e22b5393810614ddbc98e8/href">https://medium.com/media/2ae8c08366e22b5393810614ddbc98e8/href</a></iframe><h3>Setup ViewPager at activity or fragment</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3086589d7c8a137f138801eac11c2b00/href">https://medium.com/media/3086589d7c8a137f138801eac11c2b00/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c3798279bad33b1956cf9c58bde4fad4/href">https://medium.com/media/c3798279bad33b1956cf9c58bde4fad4/href</a></iframe><p>Reference</p><ul><li><a href="https://www.bignerdranch.com/blog/viewpager-without-fragments/">https://www.bignerdranch.com/blog/viewpager-without-fragments/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=906e3643fec3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Connect your MongoDB with Robo 3T]]></title>
            <link>https://medium.com/@jerrylinjf/connect-your-mongodb-with-robo-3t-3fbd5c673d30?source=rss-56e36a7cb3ba------2</link>
            <guid isPermaLink="false">https://medium.com/p/3fbd5c673d30</guid>
            <category><![CDATA[mongodb]]></category>
            <category><![CDATA[mac]]></category>
            <category><![CDATA[os-x]]></category>
            <dc:creator><![CDATA[JerryLin]]></dc:creator>
            <pubDate>Tue, 28 Nov 2017 14:07:06 GMT</pubDate>
            <atom:updated>2017-11-28T14:11:44.619Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*SlQ5dq5YWQXpiJeMWUKI7A.png" /></figure><p>安裝及下載 Robo 3T</p><pre><a href="https://robomongo.org/download">https://robomongo.org/download</a></pre><p>修改 mongod.conf</p><pre>vim /etc/mongod.conf</pre><p>dbpath 及 logpath 必須使用絕對路徑</p><p>將 bindIp 此行註解掉</p><pre>#  bindIp: 127.0.0.1</pre><p>重啟 mongodb</p><pre>service mongod restart</pre><p>檢查 log 確認 mongodb 有正確重啟</p><pre>cat /var/log/mongodb/mongod.log</pre><p>沒有的話，找到 mongodb 的 PID，kill 之後重啟</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q5YIc0WLwuowAe0AizPk0g.png" /></figure><p>雖然使用 Robo 3T 查看 mongodb 是很方便，但未設置帳號密碼時，只要知道 port 就能連接登入，很容易遭受到綁架，所以如要使用時，強烈建議要設定帳號密碼</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3fbd5c673d30" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Install Symfony 3 with MongoDB]]></title>
            <link>https://medium.com/@jerrylinjf/install-symfony-3-with-mongodb-8f45229d9a34?source=rss-56e36a7cb3ba------2</link>
            <guid isPermaLink="false">https://medium.com/p/8f45229d9a34</guid>
            <category><![CDATA[php]]></category>
            <category><![CDATA[mongodb]]></category>
            <category><![CDATA[symfony]]></category>
            <dc:creator><![CDATA[JerryLin]]></dc:creator>
            <pubDate>Sun, 15 Oct 2017 14:27:48 GMT</pubDate>
            <atom:updated>2017-11-29T05:20:09.622Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/964/1*XpVpMPzskqHjxz7o2KNnmA.png" /></figure><h3>Install Composer</h3><pre>sudo apt install php php7.0-xml php7.0-intl php7.0-dev php7.0-zip phpunit php-xml</pre><pre>php -r &quot;copy(&#39;<a href="https://getcomposer.org/installer&#39;">https://getcomposer.org/installer&#39;</a>, &#39;composer-setup.php&#39;);&quot;</pre><pre>php -r &quot;if (hash_file(&#39;SHA384&#39;,&#39;composer-setup.php&#39;) ===&#39;669656bab3166a7aff8a7506b8cb2d1c292f042046c5a994c43155c0be6190fa0355160742ab2e1c88d40d5be660b410&#39;) {echo&#39;Installer verified&#39;;} else {echo&#39;Installer corrupt&#39;; unlink(&#39;composer-setup.php&#39;);} echo PHP_EOL;&quot;</pre><pre>php composer-setup.php</pre><pre>php -r &quot;unlink(&#39;composer-setup.php&#39;);&quot;</pre><pre>sudo mv composer.phar /usr/local/bin/composer</pre><h3>Install Symfony</h3><pre>sudo mkdir -p /usr/local/bin</pre><pre>sudo curl -LsS <a href="https://symfony.com/installer">https://symfony.com/installer</a> -o /usr/local/bin/symfony</pre><pre>sudo chmod a+x /usr/local/bin/symfony</pre><h3>Install MongoDB</h3><pre>sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6</pre><pre>echo &quot;deb [arch=amd64,arm64] <a href="http://repo.mongodb.org/apt/ubuntu">http://repo.mongodb.org/apt/ubuntu</a> xenial/mongodb-org/3.4 multiverse&quot; | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list</pre><pre>sudo apt update</pre><pre>sudo apt install mongodb-org</pre><pre>sudo systemctl start mongod</pre><h3>Install the MongoDB PHP Driver with PECL</h3><pre>sudo apt install libssl-dev pkg-config php-pear</pre><pre>sudo apt install php-pear</pre><pre>sudo pecl install mongodb</pre><p>add the following line to your php.ini file</p><pre><em># /etc/php/7.0/cli/php.ini</em><br>extension=mongodb.so</pre><p>create your Symfony project than enter to it</p><pre>composer create-project symfony/framework-standard-edition YOUR_PROJECT_NAME</pre><pre>cd YOUR_PROJECT_NAME</pre><h3>Install the MongoDB adapter</h3><pre>composer require alcaeus/mongo-php-adapter</pre><h3>Install MongoDB Doctrine packages</h3><pre>composer require doctrine/mongodb-odm doctrine/mongodb-odm-bundle</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8f45229d9a34" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[讓 Nexus 5 也可以使用 NFC-SIM 卡]]></title>
            <link>https://medium.com/@jerrylinjf/%E8%AE%93-nexus-5-%E4%B9%9F%E5%8F%AF%E4%BB%A5%E4%BD%BF%E7%94%A8-nfc-sim-%E5%8D%A1-6d4750f866cc?source=rss-56e36a7cb3ba------2</link>
            <guid isPermaLink="false">https://medium.com/p/6d4750f866cc</guid>
            <category><![CDATA[nfc]]></category>
            <category><![CDATA[nexus]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[google-nexus-5]]></category>
            <dc:creator><![CDATA[JerryLin]]></dc:creator>
            <pubDate>Tue, 29 Aug 2017 16:15:16 GMT</pubDate>
            <atom:updated>2018-02-24T08:19:25.858Z</atom:updated>
            <content:encoded><![CDATA[<h3>準備</h3><ol><li>root</li><li>備份 <em>/system/etc/libnfc-brcm.conf</em><strong><em> </em></strong>及 <br><em>/system/etc/libnfc-brcm-20791b05.conf </em>這兩個檔案</li></ol><h3>方法</h3><h3><em>1. 修改 /system/etc/libnfc-brcm.conf</em></h3><p>加上 #，註解 <em>NFA_MAX_EE_SUPPORTED=0</em></p><pre>#NFA_MAX_EE_SUPPORTED=0</pre><p>加上 #，註解 ACTIVE_SE=0x0</p><pre>#ACTIVE_SE=0x0</pre><p>去掉 #，啟用 UICC</p><pre>ACTIVE_SE=0xF3</pre><p>加上於檔案最後</p><pre>###############################################################<br># Route technologies to UICC<br>DEFAULT_ISODEP_ROUTE=0xF3</pre><h3><em>2. 修改 </em>/system/etc/libnfc-brcm-20791b05.conf</h3><p>加上 #，註解第 29 行</p><pre>#NFA_DM_START_UP_CFG={45:CB:01:01:A5:01:01:CA:17:00:00:00:00:06:00:00:00:00:0F:00:00:00:00:E0:67:35:00:14:01:00:00:10:B5:03:01:02:FF:80:01:01:C9:03:03:0F:AB:5B:01:00:B2:04:E8:03:00:00:CF:02:02:08:B1:06:00:20:00:00:00:12:C2:02:00:C8}</pre><p>去掉第 32 行 # 啟用</p><pre>NFA_DM_START_UP_CFG={45:CB:01:01:A5:01:01:CA:17:00:00:00:00:06:00:00:00:00:0F:00:00:00:00:E0:67:35:00:14:01:00:00:10:B5:03:01:03:FF:80:01:01:C9:03:03:0F:AB:5B:01:02:B2:04:E8:03:00:00:CF:02:02:08:B1:06:00:20:00:00:00:12:C2:02:01:88}</pre><h3><strong>3. 修改兩個檔案權限為 rw-r-r-</strong></h3><pre>rw-r-r-</pre><h3>4. 關閉 NFC 後，重新開機再啟用 NFC 即可</h3><p>參考資料：<br><a href="http://www.cedar.tk/2014/10/NFC-SIM-(SWP)-on-Nexus-5/#conclusion"><em>http://www.cedar.tk/2014/10/NFC-SIM-(SWP)-on-Nexus-5/#conclusion</em></a></p><p><a href="https://paoyuan.org/2015/11/14/nexus-6-android-marshmallow-nfc-swp-sim-support">https://paoyuan.org/2015/11/14/nexus-6-android-marshmallow-nfc-swp-sim-support</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6d4750f866cc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Install and setup android development environment in Ubuntu]]></title>
            <link>https://medium.com/@jerrylinjf/install-and-setup-android-development-environment-in-ubuntu-3dc4eeb719b4?source=rss-56e36a7cb3ba------2</link>
            <guid isPermaLink="false">https://medium.com/p/3dc4eeb719b4</guid>
            <category><![CDATA[android-studio]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[ubuntu]]></category>
            <dc:creator><![CDATA[JerryLin]]></dc:creator>
            <pubDate>Thu, 15 Jun 2017 20:19:27 GMT</pubDate>
            <atom:updated>2017-11-29T17:41:12.455Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/478/1*i0vgB1RoNG-itA_O0VDaBg.png" /></figure><h3>Download Java</h3><pre>sudo add-apt-repository ppa:webupd8team/java</pre><pre>sudo apt-get update</pre><pre>sudo apt-get install oracle-java8-installer</pre><h3>Install Android Studio</h3><ol><li>Download <a href="https://developer.android.com/studio/index.html">Android Studio</a> from download page of Android Studio.</li><li>Unpack the file you downloaded to an appropriate location for your applications.<br>unzip android-studio-ide-162.4069837-linux.zip</li><li>Move the unpacked folder to your user profile. <br>sudo mv /home/&lt;username&gt;/Downloads/android-studio /usr/local/</li><li>Install some 32-bit libraries, if you are running a 64-bit version of Ubuntu. <br>sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 libbz2-1.0:i386</li><li>To launch Android Studio to the location of Android Studio in the bin folder. <br>cd /usr/local/android-studio/bin<br>./studio.sh</li><li>The Android Studio Setup Wizard guides you though the rest of the setup, which includes downloading Android SDK components that are required for development.</li></ol><h3>Setting up SDK Manager and AVD Manager</h3><p>Setting environment variables that targets to the tools and platform tools.</p><p>sudo gedit ~/.bashrc</p><p>append following instructions at the end of the file.</p><pre>export PATH=${PATH}:/home/&lt;username&gt;/Android/Sdk/tools</pre><pre>export PATH=${PATH}:/home/&lt;username&gt;/Android/Sdk/platform-tools</pre><h3>Create Desktop Entry</h3><p>Finally, create desktop entry that will launch Android Studio easily.</p><p>create or open exist project, select Tools &gt; Create Desktop Entry from the Android Studio menu bar.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3dc4eeb719b4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[千萬別學英語 Don’t Study, but Learn!]]></title>
            <link>https://medium.com/@jerrylinjf/overview-%E5%8D%83%E8%90%AC%E5%88%A5%E5%AD%B8%E8%8B%B1%E8%AA%9E-7d58da30db3f?source=rss-56e36a7cb3ba------2</link>
            <guid isPermaLink="false">https://medium.com/p/7d58da30db3f</guid>
            <category><![CDATA[english-language]]></category>
            <category><![CDATA[learning]]></category>
            <dc:creator><![CDATA[JerryLin]]></dc:creator>
            <pubDate>Tue, 06 Jun 2017 10:25:35 GMT</pubDate>
            <atom:updated>2017-06-14T09:05:24.054Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>第一階段：</strong></p><ul><li>選擇一卷適合自身英語程度的錄音帶</li><li>每天集中精力把 A 面和 B 面連續聽兩遍</li><li>要堅持天天聽，但每個六天要休息一天</li><li>直到聽清錄音帶中的所有內容</li></ul><p><strong>第二階段：</strong></p><ul><li>把已經能完全聽清的錄音帶中的第一卷錄音帶再找出來</li><li>聽寫這卷錄音帶的內容</li><li>做聽寫練習時，一句一句地聽。即：聽完一句後，先按暫停，把剛才聽到的寫下來，反覆聽，直到完全聽清這句為止。不會的單字根據發音大致拼寫出來即可</li><li>聽寫完整卷錄音帶的所有內容後，用英英詞典確認不會的單字的拼寫是否正確（知道其意當然好，不知道也可以）</li><li>按這種方法聽寫完整卷錄音帶的內容後，盡量完全模仿錄音帶的發音和語調，從頭到尾大聲朗讀（不滿意的部分要再聽一遍錄音帶，並重新朗讀）</li><li>感覺到所有句子都已經能朗朗上口以後，便結束這一階段</li><li>整個過程中，每個星期要有一天與英語完全隔絕</li></ul><p><strong>第三階段：</strong></p><ul><li>用英英詞典查以前做聽寫練習時不懂的單字</li><li>把單字的解釋和例句記下來，若這其中還有不懂的單字的話，繼續查字典</li><li>查字典要堅持查到沒有不懂的單字為止</li><li>大約查一個小時後，暫停查字典，並大聲朗讀通過查字典整理出來的內容</li><li>朗讀約一個小時後結束</li><li>每週要休息一天</li><li>查在原文和單字解釋中出現的所有不懂的單字，並一直朗讀到完全熟悉解釋和例句為止</li></ul><p><strong>第四階段：</strong></p><ul><li>準備一卷錄影帶</li><li>戴上耳機，每天看一遍</li><li>能夠完全聽清之後，便開始讀寫、朗讀</li><li>將不清楚的單字，利用英英詞典查詢並朗讀</li></ul><p>第五階段：</p><ul><li>準備一張最近的英文原版報紙（在美國發行的報紙）</li><li>從社會版面挑選一則短篇文章（一～二分鐘就能唸完的），然後大聲朗讀。必須堅持到完全消化為止，就好像自己成了新聞主持人一樣</li><li>當確信自己不看原文也可以記住文章內容時，把它像講一個故事一樣繪聲繪影地複述下來</li><li>能夠流利地朗讀時，再選第二篇文章，重複上面所講的方法</li><li>看完一個版面後，就像第三階段那樣處理不認識的單字</li><li>把報紙上廣告、名人訪談、漫畫等所有的內容，都按上述方法加以學習</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7d58da30db3f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Easy way to use adb on Windwos]]></title>
            <link>https://medium.com/@jerrylinjf/easy-way-to-use-adb-on-windwos-bf3d4c6037fa?source=rss-56e36a7cb3ba------2</link>
            <guid isPermaLink="false">https://medium.com/p/bf3d4c6037fa</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[windows]]></category>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[android-app-development]]></category>
            <dc:creator><![CDATA[JerryLin]]></dc:creator>
            <pubDate>Fri, 26 May 2017 11:29:59 GMT</pubDate>
            <atom:updated>2017-08-29T16:16:30.660Z</atom:updated>
            <content:encoded><![CDATA[<h3>Step</h3><ol><li>Download <a href="https://developer.android.com/studio/releases/platform-tools.html#tos-header">Android SDK Platform-Tools</a> package, that includes many tools, such as adb, fastboot, and systrace.</li><li>Extract the downloaded file.</li><li>Copy three files adb.exe, AdbWinApi.dll, AdbWinUsbApi.dll to C:\Windows.</li><li>Open <a href="http://mobaxterm.mobatek.net/">MobaXterm</a> and try to input adb, you can see the adb worked perfectly.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bf3d4c6037fa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Overview: MediaPlayer]]></title>
            <link>https://medium.com/@jerrylinjf/mediaplayer-%E9%87%8D%E9%BB%9E-8a24fd1b656?source=rss-56e36a7cb3ba------2</link>
            <guid isPermaLink="false">https://medium.com/p/8a24fd1b656</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[androiddev]]></category>
            <dc:creator><![CDATA[JerryLin]]></dc:creator>
            <pubDate>Sat, 20 May 2017 10:33:39 GMT</pubDate>
            <atom:updated>2017-06-06T09:50:19.056Z</atom:updated>
            <content:encoded><![CDATA[<p>You can play audio or video from media files stored in your application’s resources, from media standalone files in the file system, or form a data stream arriving over a network connection.</p><h3>State Diagram</h3><p>MediaPlayer have following state:</p><ol><li>Idle</li><li>Initialized</li><li>Prepared</li><li>Started</li><li>Paused</li><li>PlaybackCompleted</li><li>Stopped</li><li>Preparing</li><li>End</li><li>Error</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/665/1*NkQHmySBPr4nPUH3fTVMMA.gif" /></figure><h3>Using MediaPlayer</h3><pre>MediaPlayer mediaPlayer = MediaPlayer.create(context, R.raw.sound_file_1);<br>mediaPlayer.start();</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8a24fd1b656" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Overview: Fragment]]></title>
            <link>https://medium.com/@jerrylinjf/fragment-%E9%87%8D%E9%BB%9E-c168689770ca?source=rss-56e36a7cb3ba------2</link>
            <guid isPermaLink="false">https://medium.com/p/c168689770ca</guid>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[JerryLin]]></dc:creator>
            <pubDate>Sat, 20 May 2017 09:34:07 GMT</pubDate>
            <atom:updated>2017-05-27T06:31:39.938Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>State</strong></h3><p>onAttach() …………… onDetach()</p><p>onCreate() …………… onDestroy()</p><p>onCreateView() ……… onDestroyView()</p><p>onActivityCreate()</p><p>onStart() ……………… onStop()</p><p>onResume() …………… onPause()</p><p>onCreate(): 系統會在建立片段時呼叫這個方法。</p><p>onCreateView(): 系統會在片段初次顯示其使用者介面時呼叫這個方法。</p><p>onPause(): 系統會在使用者初次離開片段時呼叫這個方法 (即使使用者這麼做未必會刪除片段)。 您通常需要透過這個方法提交要在目前的使用者工作階段以外保留的任何變更 (原因在於使用者可能不會返回)。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/317/1*kbK7DckgeJiBgpGFQGbcog.png" /></figure><h3>新增使用者介面</h3><pre>public static class ExampleFragment extends Fragment {<br>    @Override<br>    public View onCreateView(LayoutInflater inflater, ViewGroup container,<br>                             Bundle savedInstanceState) {<br>        // Inflate the layout for this fragment<br>        return inflater.inflate(R.layout.example_fragment, container, false);<br>    }<br>}</pre><h3>將 Fragment 新增至 Activity 中</h3><pre>FragmentManager fragmentManager = <a href="https://developer.android.com/reference/android/app/Activity.html?hl=zh-tw#getFragmentManager%28%29">getFragmentManager()</a><br>FragmentTransaction fragmentTransaction = fragmentManager.<a href="https://developer.android.com/reference/android/app/FragmentManager.html?hl=zh-tw#beginTransaction%28%29">beginTransaction()</a>;<br>ExampleFragment fragment = new ExampleFragment();<br>fragmentTransaction.add(R.id.fragment_container, fragment);<br>fragmentTransaction.commit();</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c168689770ca" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>