본문 바로가기

C.E/Java

[Android] CustumListView의 Checkbox 전체선택 [JAVA] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 //전체선택버튼 Button allSelectBtn = (Button)findViewById(R.id.allSelectBtn); //전체선택 이벤트리스너 allSelectBtn.setOnClickListener(new Button.OnClickListener() { @Override public void onClick(View v) { int cnt = adapter.getCount(); //리스트뷰에 올라가있는 리스트 개수 구하기 for(int i=0; i 더보기
[Android] 간단한 ListView 구현 예제 [VIEW] [XML] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 Colored by Color Scripter cs [Activity] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 public class AlarmSetActivity extends AppCompatActivity { public static final ArrayList DAYLIST = new ArrayList( Arrays.asList("월요일","화요일","수요일") ); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(s.. 더보기
[APP] 안드로이드 스튜디오 앱 이름 바꾸기 1. app - manifests - AndroidManifest.xml 파일 로드 2. AndroidManifest.xml - 더보기
[android] 안드로이드 스튜디오 앱 버전 설정하기 (android studio set versioncode versionname) 관련 이미지가 없길래 테스트용 하나 만들어서 캡쳐 따왔어요. 안드로이드 앱 버전 설정은 android/build.gradle 에서 설정해준다. 12345678910111213android { defaultConfig { //version code 설정 versionCode 1 //version name 설정 versionName "1.0.0" multiDexEnabled true //add testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" }}Colored by Color Scriptercs 안드로이드 스튜디오 시험 있으면 딱 내기 좋은 듯..? (쭈글) Version Code1. version code는 '정수' 값이어.. 더보기
[android] Textview에 링크 넣기(달기) (android textview link) 12345678910111213141516171819202122232425public class MainActivity extends AppCompatActivity { @Overrideprotected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); TextView tvLinkify = (TextView) findViewById(R.id.tvLinkify); String text = "구글 링크."; tvLinkify.setText(text); Linkify.TransformFilter mTransform = new Linkify.Trans.. 더보기
[android] api < 21 이전 backgroundTint 해결 뭐.. API Level 21 이전을 사용하시는 분들이 이제는 존재할까 싶긴 한데요. 일단은 자료가 없어서 제가 작성해둡니다.공부하시거나 사용하시는 분들께 도움이 되었으면 좋겠네요.(API 21에서 test 해보았을 때 잘 작동합니다.) 123456ImageButton back_btn = (ImageButton)findViewById(R.id.back_btn);int background_color_blue = Color.parseColor("#0088FF"); if(Build.VERSION.SDK_INT 더보기
[android] AsyncTask 사용법 (예제) 1. AsyncTask 를 사용할 class를 만든다 2. class 명에 AsyncTask를 extends 해준다. >> public class parserX extends AsyncTask 3. 생성자를 만든다. >>public parserX(int[] ints) { this.s1 = ints; this.s_1 = ss[0]; this.s_2 = ss[1]; }3. doInBackground / onPostExecute 를 overriding 해준다. 4. AsyncTask를 사용할 activity에서 호출해준다.parserX parserX = new parserX(s); parserX.execute(); 전체 사용 예제(완전한 코드가 아닌 예제 코드입니다. 보고 따라하시는데에 문제 없을거예요.) 1.. 더보기
[android] window.*.* is not a function 관련 에러 error issue webview, android, javascript 간에 데이터를 받는 도중 에러가 도출되기 시작했다. (window.android.* is not a function) 정작 3~4시간 동안 헤메었으나 답이 너무 간단해서 어이가 없고 화가 났다.@JavascriptInterface 를 추가해주지 않아서 나타난 문제였다.(my case is annotation error.) 자바스크립트가 사용될 함수 위에 무조건 annotation을 붙여줘야한다.(if you using javascript, you must add annotation!) ㅠㅠㅠ나는 4시간이었는데.. 다른사람들은 또 얼마나 고생할까 싶어 올린다ㅠㅠㅠㅠ크흡.. 더보기