I need to detect whether the Android device is connected or disconnected to the internet on splash... if there's no connection, the application won't open.. i have try many time.. but i failed.. this is my splash's source code :
private Handler splashHandler = new Handler();
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Runnable r = new Runnable(){
        public void run(){
            Intent brain = new Intent(Splash.this, MainMenu.class);
            startActivity(brain);
            finish();
        }
    };
    setContentView(R.layout.splashscreen);
    splashHandler.postDelayed(r, 2000);
}
public void onResume(Bundle savedInstanceState){
    super.onResume();
}
}
if there's someone help me and give me a source code.. tell me where i must put it..
 
     
     
    