AndroidStudio使用偷懶外掛程式Butterknife和GsonFormat

來源:互聯網
上載者:User

標籤:params   fragment   void   ram   orm   creat   less   快速   layout   

1.Android ButterKnife Zelezny

Android Studio上安裝外掛程式,

 

配合ButterKnife實現註解,從此不用寫findViewById,想著就爽啊。在Activity,Fragment,Adapter中選中布局xml的資源id自動產生butterknife註解,點擊事件也可自動產生。

build.gradle引入

 compile ‘com.jakewharton:butterknife:7.0.1‘

 

現在載入布局檔案後面加上如下代碼:

@Overrideprotected void onCreate(Bundle savedInstanceState) {      super.onCreate(savedInstanceState);      setContentView(R.layout.activity_main);      ButterKnife.bind(this);}

布局檔案滑鼠指著載入布局檔案,右鍵即可,

2.GsonFormat

快速將json字串轉換成一個Java Bean,免去我們根據json字串手寫對應Java Bean的過程。

使用方法:快速鍵Alt+S也可以使用Alt+Insert選擇GsonFormat

AndroidStudio使用偷懶外掛程式Butterknife和GsonFormat

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.