I got two Activitys. The MainActivity
consists 4 Views (Left upper corner, right upper corner, left down corner, right down corner) which have the same size.
And now I like to show the other Activity
in one of the Views in the MainActivity
. Is this possible?
Asked
Active
Viewed 48 times
-3
-
6You can use Fragment's mechanism: https://stackoverflow.com/questions/16033602/how-to-use-fragments-in-android, https://developer.android.com/guide/components/fragments, https://stackoverflow.com/a/24960984/5529263, https://stackoverflow.com/questions/6871666/android-using-fragments-programmatically – Boken Mar 25 '19 at 10:36
-
The best thing you can do is using 4 framelayout, like you said (Left upper corner, right upper corner, left down corner, right down corner). Using one activity, you can inflate 4 fragment inside the 4 framelayout. Each fragment, like an activity, have their own view and events. – Murdok Mar 25 '19 at 10:52
2 Answers
0
You can use fragments here its link https://github.com/codepath/android-fragment-basics

HussainAbbas
- 242
- 2
- 13
0
I recommend the android's Fragments. They're just like Activities with the lifecycle and all.
But they have a tiny difference. These fragments don't have a context and use their parent's (Activity's).
Here's the google developers' link:

marc_s
- 732,580
- 175
- 1,330
- 1,459

AndroidSmoker74
- 288
- 4
- 19