android.os.NetworkOnMainThreadException 에러!
android.os.NetworkOnMainThreadException 이 에러가 발생했다.
주로 메인UI에서 쓰레드를 쓰려고 할 경우 뜨는 에러.
해결방법
1. 메인UI 외 다른 부분에서 쓰레드 만들어서 사용.
2. StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy); 사용!
2번예시
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.layout_name);
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
}
'프로그래밍 > Android' 카테고리의 다른 글
[Android] android 파일 다운로드 후 hwp파일 열기! (0) | 2015.03.26 |
---|---|
[Android] XML 파일 생성 (0) | 2015.03.18 |
[Android] if 값 비교가 제대로 안되는 경우 ex: if(a == b) (0) | 2015.03.16 |
[Android] Android 기본탐색기가 없다!! (0) | 2015.01.23 |
I/Choreographer(5855): Skipped 99 frames! The application may be doing too much work on its main thread. (0) | 2015.01.22 |
parent.document.getElementById / 적용 안되는 경우
parent.document.getElementById
누군가 이렇게 쓰라고 예시글을 올려놨었다..
ex -> exit('<script type="text/javascript">parent.document.getElementById("id").value=\'ok\'; alert(\'중복되는 아이디가 없습니다.\'); window.close();</script>');
아이디 중복체크할 때 사용하는 부분이였는데... 계속 안되길래 하나하나 찍어보면서 결국 찾았는데!
원인은
parent.document.getElementById("id").value=\'ok\';
이 문장이 적용이 안되던 것.
검색을 해보니
opener.document.getElementById("id").value=\'ok\';
이렇게 사용해야된다는 것!!!!!
'프로그래밍 > php' 카테고리의 다른 글
[MySQL] select 안에 select. (0) | 2019.12.08 |
---|---|
[APMSetup] 외부접근 허용시키기! (0) | 2015.06.18 |
[APM] 설치 (0) | 2015.06.18 |
Warning: implode() [function.implode]: Invalid arguments passed in xxx on line xx (0) | 2014.07.25 |
check the manual that corresponds to your MySQL server version for the right syntax to use near (0) | 2014.07.25 |
java.lang.IllegalStateException: Could not execute method of the activity
AndroidRuntime(17261): java.lang.IllegalStateException: Could not execute method of the activity ...
일반적으로 에러 문제가 단일문장으로 볼 수 없다.
유사한 에러로 http://stackoverflow.com/questions/23987997/android-java-lang-illegalstateexception-could-not-execute-method-of-the-activ
소켓을 사용하는데 메인 Thread에서 Network IO를 실행할 수 없다.
AsyncTask 혹은 Thread로 실행하라 라는건데..
나같은경우는 ...ㅋ... 매니페스트에서 엑티비티 등록을 안해줬기 때문에 생긴 에러! 매니페스트에 엑티비티 등록해주세요~
'프로그래밍 > C#' 카테고리의 다른 글
데이터 저장(PlayerPrefabs 사용, List 형식) (0) | 2015.02.22 |
---|---|
Invalid rank specifier: expected `,' or `]' (0) | 2015.02.16 |
error CS1519: Unexpected symbol `for' in class, struct, or interface member declaration (0) | 2014.11.04 |
자기상위오브젝트(parent object)를 호출하는 방법! (0) | 2014.01.24 |
[C#] MemoryPool(메모리풀) (0) | 2014.01.08 |
인앱 V2 쓸때 참고했던 사이트!!
'프로그래밍 > [펌]' 카테고리의 다른 글
[펌] 유니티로 타워 디펜스게임 만드는 강좌입니다. (0) | 2015.07.08 |
---|---|
[펌] 엔진 무료화 열풍! 언리얼4 (0) | 2015.03.05 |
[펌] 유니티5 개발엔진 (부분) 무료화 선언!! (0) | 2015.03.05 |
인앱 V3버전을 위해 참고사이트! (0) | 2014.11.18 |
Unity3D에서 인앱V2버전 곧 지원이 종료된다!! (0) | 2014.11.18 |
인앱 V3버전을 위해 참고사이트!
'프로그래밍 > [펌]' 카테고리의 다른 글
[펌] 유니티로 타워 디펜스게임 만드는 강좌입니다. (0) | 2015.07.08 |
---|---|
[펌] 엔진 무료화 열풍! 언리얼4 (0) | 2015.03.05 |
[펌] 유니티5 개발엔진 (부분) 무료화 선언!! (0) | 2015.03.05 |
인앱 V2 쓸때 참고했던 사이트!! (0) | 2014.11.18 |
Unity3D에서 인앱V2버전 곧 지원이 종료된다!! (0) | 2014.11.18 |
Unity3D에서 인앱V2버전 곧 지원이 종료된다!!
'프로그래밍 > [펌]' 카테고리의 다른 글
[펌] 유니티로 타워 디펜스게임 만드는 강좌입니다. (0) | 2015.07.08 |
---|---|
[펌] 엔진 무료화 열풍! 언리얼4 (0) | 2015.03.05 |
[펌] 유니티5 개발엔진 (부분) 무료화 선언!! (0) | 2015.03.05 |
인앱 V2 쓸때 참고했던 사이트!! (0) | 2014.11.18 |
인앱 V3버전을 위해 참고사이트! (0) | 2014.11.18 |
노티피케이션 로직
'프로그래밍 > Unity3D' 카테고리의 다른 글
Unity3D Google InApp V2 java.lang.NoClassDefFoundError: com.android.vending.billing.IInAppBillingService$Stub
'프로그래밍 > Unity3D' 카테고리의 다른 글
[Unity3D] (OnGUI) GUI.Label, GUI.Button (0) | 2015.04.10 |
---|---|
Error building Player: CommandInvokationFailure: Unable to convert classes into dex format. See the Console for details. (0) | 2015.02.06 |
노티피케이션 로직 (0) | 2014.11.18 |
AssetBundle을 어떻게 써야할지 개인생각... (0) | 2014.01.18 |
Destroy와 DestroyImmediate (1) | 2014.01.08 |
error CS1519: Unexpected symbol `for' in class, struct, or interface member declaration
'프로그래밍 > C#' 카테고리의 다른 글
Invalid rank specifier: expected `,' or `]' (0) | 2015.02.16 |
---|---|
java.lang.IllegalStateException: Could not execute method of the activity (0) | 2014.11.25 |
자기상위오브젝트(parent object)를 호출하는 방법! (0) | 2014.01.24 |
[C#] MemoryPool(메모리풀) (0) | 2014.01.08 |
코루틴(Coroutine)이란? Update()와 차이 (2) | 2014.01.03 |
Warning: implode() [function.implode]: Invalid arguments passed in xxx on line xx
Warning: implode() [function.implode]: Invalid arguments passed in xxx on line xx
implode 변수가 넘어갔다..
배열이 아닌걸 자를려고(?) 할때 뜨는거 같네요
implode로 자를 변수를 처음에 $array = array(); 해줍시다
혹은 안에 내용이 잘못들어갔을 경우!
'프로그래밍 > php' 카테고리의 다른 글
[MySQL] select 안에 select. (0) | 2019.12.08 |
---|---|
[APMSetup] 외부접근 허용시키기! (0) | 2015.06.18 |
[APM] 설치 (0) | 2015.06.18 |
parent.document.getElementById / 적용 안되는 경우 (0) | 2015.01.10 |
check the manual that corresponds to your MySQL server version for the right syntax to use near (0) | 2014.07.25 |