View RSS Feed

Android Development

  1. Launching Activities Using the Application Context

    by , 02-11-2012 at 01:51 PM
    Call the startActivity() method of the application context. It is most commonly used to launch the activity. startActivity() method takes only one parameter which is called Intent. The below code shows a startActivity() method with an explicit intent.

    Java Code: This is the code to launch an activity
    startActivity(new Intent(getApplicationContext(),MenuActivity.class));
    In the above code, target activity is launched on request of intent, called MenuActivity. This MenuActivity class must be registered ...