Intent intentRunActivity = new Intent(MainActivity.this, RunActivity.class); startActivity(intentRunActivity);
2015년 1월 14일 수요일
액티비티 호출하기
특정 액티비티를 호출하고 싶을 때는 아래와 같은 코드를 실행하면 됩니다.
2014년 12월 8일 월요일
안드로이드 개발 - 홈버튼 효과 내기
안드로이드 개발을 하다보면 홈버튼을 누르는 효과를 동일하게 줘야할 때가 있다.
그럴경우 아래와 같은 코드를 호출하면 간단히 해결된다.
Intent intent = new Intent(); intent.setAction("android.intent.action.MAIN"); intent.addCategory("android.intent.category.HOME"); intent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS | Intent.FLAG_ACTIVITY_FORWARD_RESULT | Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_PREVIOUS_IS_TOP | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); startActivity(intent);
피드 구독하기:
글 (Atom)