Project 내에 이미 존재하는 xml을 클릭(open)한 상태에서
프로젝트를 run 할 때 발생한다.
xml 파일이 오픈 된 상태에서 run을 하면 그 xml 파일을
포함하고 있는 프로젝트가 아니라 xml 자체를 run 하기 때문에
발생한다.
출처 : (영어) http://stackoverflow.com/questions/1674101/android-project-wont-build-when-editing-a-resource-file
2011년 3월 17일 목요일
2011년 3월 10일 목요일
[안드로이드] 웹 브라우저 띄우기 + 구글 웹 검색
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.google.com"));
startActivity(intent);
▣ gog.is 는 웹주소 중에서도 이러한 구글 검색 주소만을 줄여주는 서비스입니다. 주소창에 간단하게
라고만 입력하면 아주 간단하게 위에 구글 검색창에서 직접 검색한 것과 같은 주소로 포워딩해줍니다.
즉, gog.is/ 뒤에 검색하고자 하는 단어를 입력하기만 하면 됩니다. (단어사이는 ' + ' 혹은 ' . ' )
즉, gog.is/ 뒤에 검색하고자 하는 단어를 입력하기만 하면 됩니다. (단어사이는 ' + ' 혹은 ' . ' )
특히, 채팅창에서 친구와 대화하다가 갑자기 검색화면을 공유할 필요가 있을때, http://gog.is/무한도전+유재석+웃긴장면 라고만 입력해주면 편리합니다. 직접링크를 걸 수 없는 커뮤니티 게시판에서 뉴스검색을 간접링크로 걸때도 유용하게 쓸 수 있구요.
제작자는 누군가가 스파이웨어 제거 방법을 당신에게 묻는다면
http://gog.is/스파이웨어+제거+윈도우 나 http://gog.is/우분투+설치 로 응수하라고 하는군요. ㅎㅎ
대답해주기 귀찮을 땐 이렇게 :: Let me google that for you 서비스와 함께 이용하면 아주 유용하겠군요. ㅎㅎ
http://gog.is/스파이웨어+제거+윈도우 나 http://gog.is/우분투+설치 로 응수하라고 하는군요. ㅎㅎ
대답해주기 귀찮을 땐 이렇게 :: Let me google that for you 서비스와 함께 이용하면 아주 유용하겠군요. ㅎㅎ
2011년 2월 25일 금요일
[안드로이드] android.text
본인의 프로그램을 만들 던 중
TextView text; < 이 녀석을 전역으로 설정해 주었다.
그 후 해당 class 내부에서 text.setText("어머나어머나 이러지마세요");
를 만들어 보니,
어머나어머나 이러지마세요 가 뜨지 않는 것이었다.
이게 무슨 귀신 씨나락 까먹고 팥뿌린데 콩나는 시추에이션이란 말인가?
그래서 text1 으로 파일명을 변경해 보았더니, 잘 돌아가더란 말이었던것이었던 말이다.
그래서 text 에 대해 조사해 보니 이와 같은 내용이 나오는 게 아닌가...
이럴 수가....... text 를 instance 명으로 사용하지 않게 조심해야 겠다.
TextView text; < 이 녀석을 전역으로 설정해 주었다.
그 후 해당 class 내부에서 text.setText("어머나어머나 이러지마세요");
를 만들어 보니,
어머나어머나 이러지마세요 가 뜨지 않는 것이었다.
이게 무슨 귀신 씨나락 까먹고 팥뿌린데 콩나는 시추에이션이란 말인가?
그래서 text1 으로 파일명을 변경해 보았더니, 잘 돌아가더란 말이었던것이었던 말이다.
그래서 text 에 대해 조사해 보니 이와 같은 내용이 나오는 게 아닌가...
package
android.text
Provides classes used to render or track text and text spans on the screen.
You can use these classes to design your own widgets that manage text, to handle arbitrary text spans for changes, or to handle drawing yourself for an existing widget.
The Span… interfaces and classes are used to create or manage spans of text in a View item. You can use these to style the text or background, or to listen for changes. If creating your own widget, extend DynamicLayout, to manages the actual wrapping and drawing of your text.
Interfaces
| This is the interface for text whose content and markup can be changed (as opposed to immutable text like Strings). | |
| Please implement this interface if your CharSequence has a getChars() method like the one in String that is faster than calling charAt() multiple times. | |
| Retrieves images for HTML <img> tags. | |
| Is notified when HTML tags are encountered that the parser does not know how to interpret. | |
| This interface should be added to a span object that should not be copied into a new Spenned when performing a slice or copy operation on the original Spanned it was placed in. | |
| A special kind of Parcelable for objects that will serve as text spans. | |
| This is the interface for text to which markup objects can be attached and detached. | |
| This is the interface for text that has markup objects attached to ranges of it. | |
| When an object of this type is attached to a Spannable, its methods will be called to notify it that other markup objects have been added, changed, or removed. | |
| | |
| An interface for splitting strings according to rules that are opaque to the user of this interface. | |
| When an object of a type is attached to an Editable, its methods will be called when the text is changed. |
Classes
| An AlteredCharSequence is a CharSequence that is largely mirrored from another CharSequence, except that a specified range of characters are mirrored from a different char array instead. | |
| AndroidCharacter exposes some character properties that are not easily accessed from java.lang.Character. | |
| Annotations are simple key-value pairs that are preserved across TextView save/restore cycles and can be used to keep application-specific data that needs to be maintained for regions of text. | |
| This class accesses a dictionary of corrections to frequent misspellings. | |
| A BoringLayout is a very simple Layout implementation for text that fits on a single line and is all left-to-right characters. | |
| | |
| This class is deprecated. Old text-only interface to the clipboard. See ClipboardManager for the modern API. | |
| DynamicLayout is a text layout that updates itself as the text is edited. | |
| Factory used by TextView to create new Editables. | |
| This class processes HTML strings into displayable styled text. | |
| This filter will capitalize all the lower case letters that are added through edits. | |
| This filter will constrain edits not to make the length of the text greater than the specified length. | |
| A base class that manages text layout in visual elements on the screen. | |
| Stores information about bidirectional (left-to-right or right-to-left) text within the layout of a line. | |
| Abstract class for filtering login-related text (user names and passwords) | |
| This filter is compatible with GMail passwords which restricts characters to the Latin-1 (ISO8859-1) char set. | |
| This filter rejects characters in the user name that are not compatible with Google login. | |
| This filter rejects characters in the user name that are not compatible with GMail account creation. | |
| Convenience equivalent for when you would just want a new Object() for a span but want it to be no-copy. | |
| Utility class for manipulating cursors and selections in CharSequences. | |
| Factory used by TextView to create new Spannables. | |
| This is the class for text whose content is immutable but to which markup objects can be attached and detached. | |
| This is the class for text whose content and markup can both be changed. | |
| This is the class for text whose content and markup are immutable. | |
| StaticLayout is a Layout for text that will not be edited after it is laid out. | |
| TextPaint is an extension of Paint that leaves room for some extra data used during text measuring and drawing. | |
| | |
| A simple string splitter. |
Enums
| | |
| |
2011년 2월 24일 목요일
[안드로이드] 이클립스 자동완성 없애기
Window - Preferences - Java - Editor - Content Asist
- (Auto-activation) - Enable (auto-activation)
위와 같이 해주면 된다.
- (Auto-activation) - Enable (auto-activation)
위와 같이 해주면 된다.
[안드로이드] selector 사용하기
※ 열심히 아무것도 아니더라도 넣어둬야지!!
Layout을 만들면서 Selector라는 것을 이용하면 편하다는 것을 배웠다. 줄창 아이폰, WM 6 어플 개발만 하다보니 생소해서 열심히 삽질중이다.
drawable-hdpi 폴더에 모든 리소스 파일을 넣었다.
(버튼 업, 버튼 다운, 버튼 노말) 요런 것들을 일일히 Touch 이벤트로 받아와서 각각의 이벤트에 맞춰 이미지를 뿌려주었는데 참 편한 방법이 있었다. 바로 Selector를 사용하는 것이었다.
xml 파일의 내용을 살표 보면 다음과 같이 특이할게 없다.
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/btn_main_01_on" /> <!-- pressed -->
<item android:drawable="@drawable/btn_main_01" /> <!-- default -->
</selector>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/btn_main_01_on" /> <!-- pressed -->
<item android:drawable="@drawable/btn_main_01" /> <!-- default -->
</selector>
직관적으로 딱 봐도 알겠으니 별도 설명은 생략하고, 이렇게 만든 XML 파일을 적용시키려면 다음과 같이 하면 된다.
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/creditcard"
android:background="@drawable/btn_main_01_selector"
android:layout_marginLeft="66px"
/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/creditcard"
android:background="@drawable/btn_main_01_selector"
android:layout_marginLeft="66px"
/>
background 속성에 drawble의 버튼에 적용될 selector.xml파일을 링크 시켜주면 에뮬레이터 상에서 실행시키면 잘 반응한다. 후다닥 사용해 볼 것을 권장한다.!
피드 구독하기:
글 (Atom)