Skip to Content
Android Developer Tools深入精要
book

Android Developer Tools深入精要

by Mike Wolfson
July 2014
Intermediate to advanced
248 pages
5h 19m
Chinese
GoTop Information, Inc.
Content preview from Android Developer Tools深入精要
108
|
第七章:測試程式碼
7-14 Lint
選項
整合
Java
XML
編輯器
Lint
在預設情況下會自動執行,所以你可能已經看過
Lint
標記的錯誤。依據你的設定,
你會在打字或是儲存檔案時看到這些標記的錯誤,當
Lint
發現一個錯誤,它會放一個
標誌在錯誤的該行程式碼上,你可以將滑鼠游標停留在警告標誌或程式碼(黃色底線)
的上方來取得更多資訊。圖
7-15
7-16
顯示這在
XML
Java
編輯器中的畫面。
[Page-113]
7-15 XML
檔案裡的
Lint
警告
Lint
|
109
7-16 Java
檔案裡的
Lint
警告
快速修正工具
除了知道程式碼裡的錯誤,你可能會想要做到更多事-修正那些錯誤;有一個「快速
修正」的工具能非常簡單地修正錯誤。
使用這功能的最好方法是先選取含有錯誤的程式碼,接著在
Windows
Linux
上按
Ctrl+1
,或在
Mac OS X
上按
Command+1
在打開「快速修正」對話框之後,你會看到許多用來修正特定警告的多個選項,這與
Lint
工具列所提供的是一樣的(參考第
106
頁「
Lint
工具列選單」)。修正
XML
與修
Java
的選項畫面如圖
7-17
7-18
此功能可能無法用在你遇到的所有問題;在這情況下,系統無法使用「快速修正」的
功能,你需要自己替程式碼偵錯,且決定修正問題的方法。 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Android 高效能多執行緒

Android 高效能多執行緒

Anders Goransson
深入淺出 jQuery

深入淺出 jQuery

Ryan Benedetti, Ronan Cranley
HTML5 錦囊妙計

HTML5 錦囊妙計

Christopher Schmitt, Kyle Simpson

Publisher Resources

ISBN: 9789863470861