In my application when i click home button and when again when i open the app it should come from first.I am having splash screen as my first activity.when i open the app,the app should start from splash screen.
@Override public void onAttachedToWindow() { super.onAttachedToWindow(); this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD); } @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if(keyCode == KeyEvent.KEYCODE_HOME) { Log.i("Home Button","Clicked"); onPause(); } return false; } protected void onPause() { super.onPause(); Intent i=new Intent(H2.this,HomeexampleActivity.class); startActivity(i); // Start your first Activity as you would normally do } I tried in this way by overriding on pause method but it is not working.please help me how to solve this issue
onPause(),super.onPause()should be the first statement.