Android
Android
An activity is a single, focused thing that the user can do. Almost all activities interact with the user, so the Activity class takes care of creating a window for you in which you can place your UI with setContentView(View).
There are two methods almost all subclasses of Activity will implement: onCreate(Bundle) is where you initialize your activity. Most importantly, here you will usually call setContentView(int) with a layout resource defining your UI, and using findViewById(int) to retrieve the widgets in that UI that you need to interact with programmatically. onPause() is where you deal with the user leaving your activity. Most importantly, any changes made by the user should at this point be committed (usually to the ContentProvider holding the data).
Bundle generally use for passing data between various Activities. It depends on you what type of values you want to pass but bundle can hold all types of values and pass to the new activity. You can use it like ... Intent intent = new Intent(getApplicationContext(),SecondActivity.class); intent.putExtra("myKey",AnyValue); startActivity(intent); Now you can get the passed values by... Bundle extras = intent.getExtras(); String tmp = extras.getString("myKey");