add initial support for fragments

Fragments are not added to the View hierarchy yet. Only the lifecycle
callbacks are implemented
This commit is contained in:
Julian Winkler
2023-08-22 13:29:44 +02:00
parent 83cc2e5991
commit faf4a3281e
4 changed files with 70 additions and 3 deletions

View File

@@ -1,8 +1,16 @@
package android.app;
public class FragmentTransaction {
private Activity activity;
public FragmentTransaction(Activity activity) {
this.activity = activity;
}
public FragmentTransaction add(Fragment fragment, String string) {
fragment.activity = activity;
activity.fragments.add(fragment);
return this;
}