목록Programming (118)
2swan
.JAVA public class MainActivity2 extends AppCompatActivity { private long backBtnTime = 0; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main2); } @Override public void onBackPressed() { long curTime = System.currentTimeMillis(); long gapTime = curTime - backBtnTime; //현재 시간 가져와서 백버튼 누른 시간 빼준다 if(0 = gapTime ){..
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..
.xml .java public class Date extends AppCompatActivity { Chronometer chrono; RadioButton rdoCal, rdoTime; DatePicker dPicker; TimePicker tPicker; TextView tvYear, tvMonth, tvDay, tvHour, tvMinute; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); setTitle("시간 예약"); // 크로노미터 chrono = (Chronometer) findViewById(R..
.xml .java public class MainActivity2 extends AppCompatActivity { TextView text1, text2; Switch switchAgree; RadioGroup rGroup1; RadioButton radioArray[] = new RadioButton[3]; ImageView imgPet; Button btnQuit, btnRerun; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main2); setTitle("안드로이드 사진 보기"); // 위젯을 변수에 대입 te..
해결방법 manifests 폴더의 xml의 파일에 접근하여 exported는 true intent-filter를 추가 해준다.
web.xml web.java public class MainActivity7_webview extends AppCompatActivity { EditText edtUrl; Button btnGo, btnBack; WebView web; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main_activity7_webview); getSupportActionBar().setDisplayShowHomeEnabled(true); getSupportActionBar().setIcon(R.drawable.q10); edtUrl = ..
tab1.xml tab1.java public class MainActivity7_tab extends TabActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main_activity7_tab); TabHost tabHost = getTabHost(); TabHost.TabSpec tabSpecSong = tabHost.newTabSpec("SONG").setIndicator("음악별"); tabSpecSong.setContent(R.id.tabSong); tabHost.addTab(tabSpecSon..
main1.java //첫번째 결과 값 public class MainActivity2_dialog extends AppCompatActivity { private Button button; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main_activity2_dialog); button = findViewById(R.id.button1); button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { ..
main.xml main.java public class MainActivity2_ContextMenu extends AppCompatActivity { private LinearLayout baseLayout; private Button button1, button2; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main_activity2_context_menu); setTitle("배경색 바꾸기 (컨텍스트 메뉴)"); button1 = findViewById(R.id.button1); button2 = findV..
main.java /*메뉴*/ public class MainActivity extends AppCompatActivity { private LinearLayout baseLayout; private Button button; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); setTitle("배경색 변경"); baseLayout = findViewById(R.id.baseLayout); button = findViewById(R.id.button1); } @Override public boolean onCr..