ref:
https://enoent.fr/blog/2015/01/18/recyclerview-basics/
實作RecyclerView前,詳細建議先看此文章。
搜尋此網誌
2016年8月28日 星期日
2016年8月20日 星期六
【Android Studio】ddms: 'adb.exe,start-server' failed — run manually if necessary
ref :
http://stackoverflow.com/a/38310713
每次都是Android Studio更新後,就出現一對問題
一下子是Grandle有錯誤,弄了好久,之後又出現
ddms: 'adb.exe,start-server' failed — run manually if necessary
連不上Genymotion
所以沒事不要更新。
解決辦法:
http://stackoverflow.com/a/38310713
每次都是Android Studio更新後,就出現一對問題
一下子是Grandle有錯誤,弄了好久,之後又出現
ddms: 'adb.exe,start-server' failed — run manually if necessary
連不上Genymotion
所以沒事不要更新。
解決辦法:
Sometimes there are conflicts between ADB Genymotion and ADB SDK because both of them use the same port. So I recommend always set up ADB Genymotion to use the ADB SDK, in that way to avoid incompatible issues.
Genymotion-> Settings -> ADB -> Use custom Android SDK tools (here your set up your sdk android location).
2016年8月8日 星期一
【Android】UI Thread
ref:
https://ptodue.gitbooks.io/book2/content/2.1.2.html
http://ptodue.blogspot.tw/search/label/Runnable
http://ptodue.blogspot.tw/search/label/runOnUiThread
想執行在UI thread,可以呼叫 Activity.runOnUiThread() method。
假設目前的thread已經是在UI thread中,Runnable會立即的去執行。否則會透過UI thread的 MessageQueue 排隊。
new Handler(Looper.getMainLooper()).post(runnable);
以上面例子可以改寫成
或是改寫成
https://ptodue.gitbooks.io/book2/content/2.1.2.html
http://ptodue.blogspot.tw/search/label/Runnable
http://ptodue.blogspot.tw/search/label/runOnUiThread
想執行在UI thread,可以呼叫 Activity.runOnUiThread() method。
假設目前的thread已經是在UI thread中,Runnable會立即的去執行。否則會透過UI thread的 MessageQueue 排隊。
new Handler(Looper.getMainLooper()).post(runnable);
以上面例子可以改寫成
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Runnable r = new Runnable() { | |
@Override public void run() { | |
// Block of code to execute | |
System.out.println("Runnable run() method executed.") | |
((Activity) mContext).runOnUiThread(new Runnable() { | |
public void run() { | |
//這邊是呼叫main thread handler幫我們處理UI部分 | |
System.out.println("call UI thread to deal with UI part") | |
} | |
}); | |
} | |
}; | |
Thread t = new Thread(r); t.start(); |
或是改寫成
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
view.post(new Runnable(){ | |
public void run(){ | |
//update UI | |
} | |
}); |
【Android】Thread
ref:
https://ptodue.gitbooks.io/book2/content/2.1.2.html
http://ptodue.blogspot.tw/search/label/Runnable
http://ptodue.blogspot.tw/search/label/runOnUiThread
實作Thread常用的使用方法有2種:
https://ptodue.gitbooks.io/book2/content/2.1.2.html
http://ptodue.blogspot.tw/search/label/Runnable
http://ptodue.blogspot.tw/search/label/runOnUiThread
實作Thread常用的使用方法有2種:
- 繼承Thread class,再override實現run() method
- implements Runnable(實作Runnable interface), 再override實現run() method。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyThread extends Thread { | |
public MyThread() { | |
super("MyThread"); | |
} | |
public void run() { | |
System.out.println("Thread run() method executed."); | |
} | |
} | |
//Started with a "new MyThread().start()" call |
或是簡寫
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Thread t = new Thread() { | |
@Override | |
public void run() { | |
// Block of code to execute | |
// worker thread(background thread),處理需長時間或大量的運算 | |
System.out.println("Thread run() method executed."); | |
} | |
}; | |
t.start(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyRunnable implements Runnable { | |
public void run() { | |
//Code | |
System.out.println("Runnable run() method executed."); | |
} | |
} | |
//Started with a "new Thread(new MyRunnable()).start()" call |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Runnable r = new Runnable() { | |
@Override | |
public void run() { | |
// Block of code to execute | |
System.out.println("Runnable run() method executed."); | |
} | |
}; | |
Thread t = new Thread(r); | |
t.start(); |
2016年8月1日 星期一
【Finance】終身(手術醫療/住院醫療)險
以前家裡長輩被業務慫恿買了這兩個真順心雙安險( 萬一用倒,醫療有依靠!終身保障,醫療沒煩惱!)。直到現在需要理賠時,仔細看看保單條文,真的是羊毛出現在細節上,難怪常常在網路上看到不推薦買終身醫療險,剛好雙安就是大家不推的之一。
先說明保險的目的就是在風險發生後可以補償損失。個人感覺,終身險就是每年把終身需繳的的保費攤平至10~20年繳清。
其優點如下:
- 可以保本。
- 費率固定繳10~20年就可以擁有終身保障。就宣傳單上來看,保險範圍廣,包含住院療養、住院回診、加護病房、燒燙傷病房、門診手術、急診、緊急醫療運送、住院手術、重大疾病、意外創傷縫合...等很多項。
- 無理賠紀錄增值保險金。
再來就是不算優點的重點:
當時保單合約上,手術的定義是"全民健康保險醫療費用支付標準第二部第二章第七節或第三部第三章第四節第二項所列舉之手術者"。
ref:
所以在[1]上寫的手術才有理賠,而[2]這項目根本不在了。這就是問題所在,因為買的是終身險,保單條款在簽約在的那一刻就固定了。也就是說健保有給付,且列在[1]的手術才有理賠。也就是說,現在有新的醫療技術,而有新的醫療項目名稱。雖然健保有給付,部分材料費需自付,但沒列在[1]項目中,所以保險不理賠。
再來門診手術的定義:當時保單上沒解釋,在金融消費評議中心網站查詢。
ref:門診手術定義
所稱「門診手術」就是患者於門診後,經醫師評估需手術治療且手術後患者本身或家人有自我照顧的能力,即由醫師預約手術日期,患者於安排手術當天到手術室報到,進行麻醉手術、經麻醉恢復觀察後,即可回家休息,無需住院治療。但有關「手術」二字採廣義或狹義解釋,應視條款規定。
但是現在保險公司以[1][2]的部分,說明門診手術不在[1][2]所列之手術,所以拒賠。
這樣對保戶來說,很不利。仔細看看[1]所列之手術,幾乎都屬"住院手術"範圍,在加上[2]所列之項目已消失,等於門診手術跟住院手術無一般區別。
接下來
通貨膨脹問題:小時候雞排一份25 30元就好,超過35元就很貴了。但是現在雞排一份基本40元起跳,終身險均是定額理賠。基本額度1000元/日,難保10年20年後這樣的額度夠用。
住院的問題:
現行DRGs制度實施,所以可能會造成住院天數減少。可能病還沒達到可自行照護部份,就被請出院(有遇過)。要求自費項目增加,所以住院醫療雜費也跟著增加。而根據2009健保局統計資料 (ref:page 44),每次住院,大概只有 ¼ (26%) 的錢花在病床費上。 住院 + 手術 一共也只佔了 35% 的比例。未來也可能會從手術變為處置。
這時手術和住院醫療險就沒包含到此風險,等於花高額保費,終身保障(?)。
ref:健保DRGS實施後對民眾的優缺點
最後其實想argue的點是送交保險理賠申請後,過了1、2個禮拜,完全沒有後續消息,包含到件處理中之類的簡訊或e-mail、電話完全沒有,就算是最後不予理賠,連個告知訊息也沒有。傻眼!
訂閱:
文章 (Atom)