목록Programming/Android Example (37)
2swan
AndroidManifest.xml, Gradle Scripts 파일에 추가 main.xml item_list.xml main.activity public class MainActivity extends AppCompatActivity { private PhotoInterface photoInterface; private PhotoInterface postInterface; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button btnPhoto = findViewById(R.id.btnPhoto); B..
main.xml main.activity public class MainActivity2 extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main2); ProgressBar progressBar = findViewById(R.id.processBar1); Button btnInc = findViewById(R.id.btnInc); Button btnDec = findViewById(R.id.btnDec); SeekBar seekBar = findViewById(R.id...
main.xml main.activity //오디오 음악듣기 public class MainActivity extends AppCompatActivity { private MediaPlayer mediaPlayer; private SeekBar pbMp3; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Switch switch1 = findViewById(R.id.switch1); pbMp3 = findViewById(R.id.pbMP3); pbMp3.setOnSeekBarChangeListener(new..
main.xml fragment_tab1.xml fragment_tab2.xml fragment_tab3.xml main.activity public class MainActivity3 extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main3); TabLayout tabLayout = findViewById(R.id.layout_tab); ViewPager2 viewPager2 = findViewById(R.id.pager_content); ContentPagerAda..
main.xml fragment_one.xml fragment_two.xml fragment_three.xml fragment_four.xml main.activity public class MainActivity2 extends AppCompatActivity { private int num_page = 4; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main2); ViewPager2 viewPager2 = findViewById(R.id.viewpager); FragmentStateAdapter fragment..
main.xml item_viewpager.xml main.activity public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ViewPager2 viewPager2 = findViewById(R.id.viewPager2); Button btnToggle = findViewById(R.id.btnToggle); ArrayList list = new ArrayList(); list.add(new DataPage(Col..
main.xml item_phone4.xml main.activity public class MainActivity4 extends AppCompatActivity { private int position; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main4); EditText etName = findViewById(R.id.etName); EditText etTel = findViewById(R.id.etTel); Button btnInsert = findViewById(R.id.btnInsert); Butto..
main.xml item_phone3.xml layout_add3.xml main.activity public class MainActivity3 extends AppCompatActivity { private PhoneAdapter3 phoneAdapter3; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main3); Button btnList = findViewById(R.id.btnList); RecyclerView recyclerView = findViewById(R.id.recyclerView); Float..
main.xml person_item.xml main.activity public class MainActivity2 extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main2); RecyclerView recyclerView = findViewById(R.id.recyclerView); PersonAdapter personAdapter = new PersonAdapter(); LinearLayoutManager linearLayoutManager = new Linear..
main.xml movie.xml MovieAdapter.activity package com.example.app08; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; import java.util.ArrayList; public class MovieAdapter extends RecyclerView.Adapter { ArrayListmovieList; //setter publ..
열 이름 데이터 형식 diaryDate char(10) content varchar(500) main.xml main.activity public class MainActivity3 extends AppCompatActivity { SQLiteDatabase sqLiteDatabase; String diaryDate; MyDBHelper myDBHelper; Button btnWrite; EditText edtDiary; DatePicker datePicker; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main3..
main.xml item_recyclerview.xml main.activity public class MainActivity extends AppCompatActivity { private RecyclerView mRecyclerView; private MyRecyclerAdapter mRecyclerAdapter; private ArrayList mfriendItems; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mRecyclerView = (RecyclerView) findViewById(R.id..