내가 다음 코드를 통해 안드로이드 바로 가기를 만들이 죽일어떻게 새로운 응용 프로그램 인스턴스를 만들 안드로이드 바로 가기를 클릭하지 않도록하고, 이전
다음Intent shortcut = new Intent("com.android.launcher.action.INSTALL_SHORTCUT"); shortcut.putExtra(Intent.EXTRA_SHORTCUT_NAME,getString(R.string.app_name)); Intent shortcutIntent = new Intent(); shortcutIntent.setClassName(this,MainActivity.class.getName()); shortcut.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent); shortcut.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); shortcut.addFlags(Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); ShortcutIconResource iconRes = Intent.ShortcutIconResource.fromContext(this, R.drawable.ic_launcher); shortcut.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, iconRes); sendBroadcast(shortcut);
난 내 응용 프로그램을 열고 마침내 BActivity 같은 일부 활동에서, 내가 홈 화면으로 전환하고 바로 가기를 클릭하면, 위의 코드와 같이 MainActivity에있는 응용 프로그램이 나오게됩니다.이 문제를 피할 수 있고 이미 생성 된 경우 응용 프로그램을 포 그라운드로 만들 수 있습니까?
어쩌면이 당신을 도울 수
이 LaucherClass의에서 onCreate에 위의 코드를 추가하여 다음과 같은 수 있습니다 http://stackoverflow.com/questions/12303663/android-resume-app-from- 이전 위치 –