i’m trying to jump from activity one to activity two but after 1 second. So i used Thread.sleep(1000) and after that the activity two comes to front.Its working good but problem is I have given a image background in activity one which is not shown.
public class Activity1 extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
try {
Thread.sleep(1000);
Intent i=new Intent(Activity1.this,Activity2.class );
startActivity(i);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
additionally I included a button in Activity two which does the functionality of jumping to Activity one, in this case the image is shown for 1 second but not the first time when I open up my app.
You can create RelativeLayout and show/hide it and use 1 Activity only