분류 전체보기 (61) 썸네일형 리스트형 ListView ListView 과정 1. 메인액티비티에서 데이터를 어댑터(Adapter)에 보내주기 2. 어댑터(Adapter)에서 아이템을 listview_item.xml에 하나하나씩 넣어준다 3. 최종적으로 메인택티비티에 있는 listview에 넣어준다 어댑터(Adapter) - 데이터와 뷰를 짝지어 준다 - 요청시 해당 번째 데이터를 준다 - 데이터가 변경되었을 때 갱신해준다 어댑터(Adapter)의 종류 BaseAdapter(기본형태) - ArrayAdapter : 배열 타입 - CursorAdapter : 데이터 전용 - SimpleAdapter : 정적 XML 나머지들은 BaseAdapter을 상속받는다(나머지들은 잘 사용안한다) 1. 메인액티비티에 listview만들어주기 2. 어답터 만들기 (new- k.. 데이터 바인딩 1. 환경설정하기 모듈 수준의 gradle에 추가 dataBinding{ enabled = true } 2. 레이아웃 설정하기 최상위 루트 코드를 layout으로 설정하기 3. 메인 액티비티 class MainActivity : AppCompatActivity() { private lateinit var binding : ActivityMainBinding override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) // 1번 - findViewById이용 /*val btn = findViewById(R.id.testBtn) btn.setO.. 2530번: 인공지능 시계 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int A = sc.nextInt(); int B = sc.nextInt(); int C = sc.nextInt(); int D = sc.nextInt(); System.out.println((A+(B+(C+D)/60)/60)%24+" "+(B+(C+D)/60)%60+" "+(C+D)%60); } } 2480번: 주사위 세개 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); int sum = 0; if(a==b && a==c && b==c) { sum = 10000 + a * 1000; } else if(a==b || a==c ) { sum = 1000 + a * 100; } else if (b==c) { sum = 1000 + b * 100; } else { sum = Math.max(a, Math.max(b, c)) * 100; } Sy.. 2440번: 별 찍기 -3 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); for (int i=0; i < n; i++) { for (int j=i + 1; j 2439번: 별 찍기 -2 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); for (int i=1; i 1264번: 모음의 개수 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while(true){ String word = sc.nextLine(); int cnt = 0; if(word.equals("#")) break; for(int i=0;i 2741번: N 찍기 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); for(int i=1; i 이전 1 ··· 3 4 5 6 7 8 다음