I have a working surge
public class MainSplash extends AppCompatActivity { private final int SPLASH_DISPLAY_LENGTH = 1000; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.splash); new Handler().postDelayed(new Runnable() { @Override public void run() { Intent mainIntent = new Intent(MainSplash.this, MainMenu.class); MainSplash.this.startActivity(mainIntent); MainSplash.this.finish(); } }, SPLASH_DISPLAY_LENGTH); } }
and I want to add some buttons like share , more , etc.
and wen I do this by removing the handler and SPLASH_DISPLAY_LENGTH , adding buttons to xml and processing clicks on them just like any other actions, and set the Start button to launch MainActivity , t25> starts after a few seconds (after 1, 2 seconds of loading )
But I want to handle MainActivity load MainActivity in SplashActivity ,
How can i do this?
Here is an example of SplashActivity after adding buttons
public class MainSplash extends AppCompatActivity implements View.OnClickListener {
java android splash-screen
Max Jan 28 '16 at 7:07 2016-01-28 07:07
source share