반응형 안드로이드29 클립보드로 텍스트복사하기 ClipboardManager clipboardManager = (ClipboardManager)getSystemService(CLIPBOARD_SERVICE); ClipData clipData = ClipData.newPlainText("클립보드라벨명", "복사할 텍스트"); clipboardManager.setPrimaryClip(clipData); 출처: https://yonoo88.tistory.com/1059 [yonoo's] 2019. 4. 16. 파일 입출력 Android 내부 저장소에 텍스트 파일(.txt) 읽기 및 쓰기 방법입니다. /////////////////////// 파일 쓰기 /////////////////////// String str = input_text.getText().toString(); // 파일 생성 File saveFile = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "/camdata"); // 저장 경로 // 폴더 생성 if(!saveFile.exists()){ // 폴더 없을 경우 saveFile.mkdir(); // 폴더 생성 } try { long now = System.currentTimeMillis(); // 현재시간 받아오기 Date.. 2019. 4. 4. 업데이트체크 Gradle에 compile 'org.jsoup:jsoup:1.9.2' 추가 private class Version extends AsyncTask { @Override protected void onPreExecute() { super.onPreExecute(); } @Override protected String doInBackground(Void... params) { // Confirmation of market information in the Google Play Store try { Document doc = Jsoup .connect( "https://play.google.com/store/apps/details?id=com.nose.r.calc") .get(); Elements Versi.. 2019. 4. 3. 뒤로가기(back button) 종료 묻기 public void onBackPressed() { // 2. 다이얼로그를 생성한다. Builder builder = new AlertDialog.Builder(this); builder.setTitle("알림"); builder.setMessage("앱을 종료하시겠습니까?"); builder.setNegativeButton("취소", null); builder.setPositiveButton("종료", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // 3. 다이얼로그의 긍정 이벤트일 경우 종료한다. android.os.Process.killProcess(a.. 2019. 3. 20. 이전 1 2 3 4 5 6 ··· 8 다음 반응형