Skip to content

Instantly share code, notes, and snippets.

@chukitow
Created January 8, 2014 17:46
Show Gist options
  • Save chukitow/8321073 to your computer and use it in GitHub Desktop.
Save chukitow/8321073 to your computer and use it in GitHub Desktop.
package com.example.threads;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Thread timer = new Thread(){
public void run()
{
try
{
sleep(5000);
}
catch(InterruptedException e)
{
}
finally
{
Intent openHelloLayout = new Intent(MainActivity.this,HelloActivity.class);
startActivity(openHelloLayout);
}
}
};
timer.start();
}
@Override
protected void onPause()
{
super.onPause();
finish();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment