I have been writing this code and it is running properly before, but now its giving exception. If there is anything i have to do in Manifest file or anywhere else please help. I want to show a Blank screen with a drawable set behind and after sleep time of 5000 it must transfers the activity.
package com.example.app3;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;
public class Welcome extends Activity {
TextView tv;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.welcome);
tv = (TextView)findViewById(R.id.textView1);
Thread t1 = new Thread(){
public void run(){
try {
Thread.sleep(7000);
finish();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally{
Intent inn = new Intent(Welcome.this,MainActivity.class);
startActivity(inn);
}
}
};
t1.start();
}
}