본문 바로가기
728x90

안드로이드33

[android studio] Class referenced... Cannot resolve class ... 오류 해결 한번씩 android studio를 쓰다보면 프로젝트가 기존에 없었던 오류로 빨간 줄들이 막 생겨나는 경우가 있다. Class referenced in the layout file, `com.sothree.slidinguppanel.SlidingUpPanelLayout`, was not found in the project or the libraries Cannot resolve class com.sothree.slidinguppanel.SlidingUpPanelLayout 이와 비슷한 오류로 Class referenced in the layout file... Cannot resolve class...로 시작하는 해당 class를 찾을 수 없다고 빨간 줄들이 막 끄여버리는 경우가 있다. 1번 해결책 B.. 2021. 11. 10.
[android studio] themes 색상, 상태바 액션바 색상변경 앱에서 상단 상태bar와 타이틀 bar의 색상을 변경하는 부분을 알아보자. 위 themes.xml 파일에서 colorPrimary 속성과 colorPrimaryVariant 속성을 변경하면 아래 이미지의 해당 부분의 색상을 변경할 수 있다. 2021. 11. 7.
[android studio] 스플래시(Splash) 화면 만들기 앱 시작시에 나타나는 초기 화면을 만들어 보자. 1. 우선 시작시에 실행할 java 파일을 만들어 주자. 최소 실행할 파일을 [SplashActivity]라 이름을 주고 아래와 같이 코드를 넣었다. Handler handler = new Handler(); @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); handler.postDelayed(new Runnable() { @Override public void run() { Intent intent = new Intent(getApplicationContext(), MainActivity.class); start.. 2021. 11. 5.
[android studio] Cleartext HTTP traffic to...not permitted 오류 앱 개발 도중 volly를 이용하여 api를 호출하여 결과 값을 받아와야 하는데, 리턴시에 [Cleartext HTTP traffic to www.***** not permitted]라는 오류가 발생하였다. api쪽에서 제공할 때 오류인가 생각하다가 웹에서 호출시에는 정상적으로 결과가 나와 android studio에 뭔가 누락됐을꺼 같아 찾아보다보니 역시나 내 실수였다. http로 호출시에 일반 텍스트 트래픽 사용에 대한 앱의 요청을 할 수 있도록 [AndroidManifest.xml] 파일 안 2021. 11. 5.
[android studio] google maps API 사용방법 정리 구글 맵 연동을 한번 해보자. 우선 맵 api를 가져올 android studio 프로젝트가 없다면 미리 생성을 해두자. 1. https://console.cloud.google.com/apis/dashboard 주소로 들어가, 새 프로젝트를 생성하고 API 및 서비스 항목에서 API 및 서비스 사용 설정을 클릭을 한다. 리스트 중 [Maps SDK for Android] 항목을 클릭하여 [사용] 버튼을 클릭하여 API를 활성화 한다. 2. API 및 서비스에서 [사용자 인증 정보]에 들어가 [+ 사용자 인증 정보 만들기]를 클릭하면 몇개의 메뉴가 나타난다. API 키를 클릭하면 아래와 같이 API 키가 생성된다. 하단에 있는 [키 제한]을 클릭한다. 앞에서 생성된 키의 제한 이름 등 변경가능하다. 애플.. 2021. 11. 5.
[android studio] context 종류 및 역활 View.getContext() 현재 실행되고 있는 View의 Context를 return 보통은 현재 활성화된 Activity의 Context가 됨 Activity.getApplicationContext() Applcation Lifecycle에 해당하는 Context를 return ContextWrapper.getBaseContext() 자신의 Context가 아닌 다른 Context에 접근할 때 사용 2021. 11. 4.
728x90