android - Activity as a intent receiver to just start another and quit -


my app can called different intents, android tv. have created special activity proper intent filter in manifest. (if intent (tv) starting main activity gave problems, specific activity works well)

my question is, tvactivity starts main activity in oncreate() , should stop has no further use. calling finish in oncreate() or onstart() seems bad idea. clean , safe way kill activity , leave other running?

i'm not sure got question right, can see common usage of splashactivity :

/** called when activity first created. */     @override     public void oncreate(bundle icicle) {                super.oncreate(icicle);         requestwindowfeature(window.feature_no_title);         setcontentview(r.layout.splash_screen);          /* new handler start menu-activity           * , close splash-screen after seconds.*/         new handler().postdelayed(new runnable(){             @override             public void run() {                 weekplanhepler.isloggedin(splashactivity.this);                 intent mainintent = new intent(splashactivity.this, youractivity.class);                 splashactivity.this.finish();                 splashactivity.this.startactivity(mainintent);             }         }, splash_display_length);     } 

as see, it's finished before starting because no longer need it, so, if have similar situation, it's ok finish whenever new activity starts


Comments