[카테고리:] Development
코딩과 관련된 글들
취미 기록용 블로그
코딩과 관련된 글들
File apkFile = new File(apk파일경로); if(apkFile.exists() == true ){ Intent intent2 = new Intent(Intent.ACTION_VIEW); intent2.setDataAndType( Uri.fromFile(apkFile), “application/vnd.android.package-archive”); this.startActivity(intent2); } 안드로이드에서 APK 설치하게 해주는 명령 “read more”
Intent intent = this.getPackageManager().getLaunchIntentForPackage(패키지명); this.startActivity(intent); 별다른 권한은 필요치 않음 “read more”
다른 액티비티 상태에서 종료를 원할때 public class TestMain extends Activity { public static Activity mainAct; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mainAct = TestMain.this; } @Override protected void onDestroy() { ActivityManager am = (ActivityManager) getSystemService(ACTIVITY_SERVICE); am.restartPackage(getPackageName()); super.onDestroy(); } } public… “read more”
플젝하다가 데이터 있는 sd 카드 갑자기 뽑히면 어떻게 하나 고민하다가 인텐트 날라온다고 해서 그거 등록해서 처리 할려는데 다 해준거 같은데 안온다 -_-;; 아씨검색에 검색을 하다가 방법을 찾았다. 잘 날라온다 <intent-filter> <action android:name=”android.intent.action.MEDIA_EJECT”/> <action android:name=”android.intent.action.MEDIA_BAD_REMOVAL”/> <action android:name=”android.intent.action.MEDIA_MOUNTED”/> <action android:name=”android.intent.action.MEDIA_REMOVED”/> <action android:name=”android.intent.action.MEDIA_UNMOUNTED”/>… “read more”
private TimerTask second; second = new TimerTask() { @Override public void run() { //뭔가 하고 싶은 작업 } }; Timer timer = new Timer(); timer.schedule(second, 3000); 비슷한지 아닌지는 잘 모르겠다만 이렇게 해주면 된다. 저 스케쥴러에 뒤에 숫자는 시간으로 예제는 3초마다… “read more”
3d프린터 AI이미지 Android Buying C# C Language DVD Game Story Golang Java Linux MacOS Netflix PS3 PS4 PSN Review SSD stable-diffusion Waifu2x Web XBOX 게임 엔딩 게임패스 구글 넵튠 넷플릭스 마우스 맥미니 배터리 버그 블루레이 블루투스 사용기 소니 소비전력 스팀 스피커 아마존 알리익스프레스 여름휴가 여행 영화 외장하드 우분투 워드프레스 자전거 책 해외여행 해외직구
Copyright© 2005-2026 Linsoo All Rights Reserved.