How many files will be included in a single android activity ?
Answers
Yes you can. But you should define one as default by CATEGORY_DEFAULT. Without default main activity if you have two activities, Android Market do not know what activity to start.
<activity
android:name=".FirstMainActivity"
android:label="First Activity"
android:icon="@drawable/first_icon">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
Answer:
Code
Explanation:-
Within the lifecycle callback methods, you can declare how your activity behaves when the user leaves and re-enters the activity. For example, if you're building a streaming video player, you might pause the video and terminate the network connection when the user switches to another app. When the user returns, you can reconnect to the network and allow the user to resume the video from the same spot. In other words, each callback allows you to perform specific work that's appropriate to a given change of state. Doing the right work at the right time and handling transitions properly make your app more robust and performant. For example, good implementation of the lifecycle callbacks can help ensure that your app avoids: As a user navigates through, out of, and back to your app, the Activity instances in your app transition through different states in their lifecycle. The Activity class provides a number of callbacks that allow the activity to know that a state has changed: that the system is creating, stopping, or resuming an activity, or destroying the process in which the activity resides.
Code-
<activity
android:name=".FirstMainActivity"
android:label="First Activity"
android:icon="@drawable/first_icon">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
For more refers to-
https://brainly.in/question/48902948?referrer=searchResults
https://brainly.in/question/12085446?referrer=searchResults
#SPj3