목록Programming/Android Example (37)
2swan
main.xml song.xml artist.xml album.xml main.activity public class MainActivity3 extends AppCompatActivity implements View.OnClickListener{ Button btnSong, btnArtist, btnAlbum; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main3); btnSong = findViewById(R.id.btnSong); btnArtist = findViewById(R.id.btnArtist); bt..
main.xml . main.activity public class MainActivity extends AppCompatActivity { SQLiteDatabase sqLiteDatabase; TextView textView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); EditText edDB = findViewById(R.id.edDB); EditText edTable = findViewById(R.id.edTable); textView = findViewById(R.id.textView); Bu..
main.xml dialog.xml main.activity public class MainActivity7_grid extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main_activity7_grid); setTitle("그리드 뷰 영화 포스터"); GridView gridView = findViewById(R.id.gridView1); MyGridAdapter gridAdapter = new MyGridAdapter(this); gridView.setAdapter(g..
main.activity public class MainActivity6_list extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main_activity6_list); EditText edtItem = findViewById(R.id.edtItem); Button btnAdd = findViewById(R.id.btnAdd); ListView listView = findViewById(R.id.listView1); ArrayListarr = new ArrayList()..
main.activity public class MainActivity5 extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main5); setTitle("리스트 뷰 테스트"); ListView listView1 = findViewById(R.id.listView1); String[ ] mid = {"리스트 뷰 String 1","리스트 뷰 String 2", "리스트 뷰 String 3", "리스트 뷰 String 4","리스트 뷰 String 5", "리스트 뷰 Str..
main.activity public class MainActivity3 extends AppCompatActivity { private ActivityMain3Binding binding; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //바인딩 객체 초기화 첫번째 방법 binding = ActivityMain3Binding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); setTitle("암시적 인텐트 예제"); //바인딩 객체 초기화 두번째 방법 // binding = ActivityMain3Bindin..
main.xml input.xml output.xml stu.xml main.activity public class MainActivity2 extends AppCompatActivity { private String name, age, phone; private Student student; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main2); Button btnDataInput = findViewById(R.id.btnDataInput); Button btnDataOut = findViewById(R.id...
main.xml sub.xml main.activity public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button button = findViewById(R.id.btnAdd); EditText edtNum1 = findViewById(R.id.edtNum1); EditText edtNum2 = findViewById(R.id.edtNum2); ActivityResultLauncher launcher = reg..
main.xml input.xml output.xml stuput.xml Student.java (class) public class Student implements Serializable { private int sno; private String name; private String major; public Student(){ } public Student(int sno, String name, String major) { this.sno = sno; this.name = name; this.major = major; } public int getSno() { return sno; } public void setSno(int sno) { this.sno = sno; } public String ge..
main.xml second.xml third.xml four.xml main.java public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); RadioButton rdoSecond = findViewById(R.id.rdoSecond); RadioButton rdoThird = findViewById(R.id.rdoThird); RadioButton rdoFour = findViewById(R.id.rdoFour); ..
.xml .java public class MainActivity2 extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main2); RatingBar ratingBar1 = findViewById(R.id.ratingBar1); RatingBar ratingBar2 = findViewById(R.id.ratingBar2); RatingBar ratingBar3 = findViewById(R.id.ratingBar3); Button btnInc = findViewById(R..
main.xml sub.xml main.java public class MainActivity3 extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main3); Button btnResult = findViewById(R.id.btnResult); //투표수 저장 배열 int countVote[] = new int[9]; ImageView image[] = new ImageView[9]; //이미지 뷰 저장 배열 String ImageName[] = { "pic1","pi..