Reputation: 1072
I am looking for a hint/way how to achieve such a "layout" in android. What I have so far is layout of mainActivity, on which is embedded fragment A. What I wanna do, is place above fragment A next one (Fragment B). For better illustration image is included.
How should I implement such a composition ? Also, after click on "Save" it should process inserted information a fragment should be hidden/removed. Thanks in advance
Upvotes: 0
Views: 48
Reputation: 14027
fragment_register_account.xml
RegisterAccountDialog
that extend DialogFragment
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_register_account, container); mEditText = (EditText) view.findViewById(R.id.txt_your_name); getDialog().setTitle("Hello"); return view; }
3.Register onClick to your 'Create new Account' button and show the DialogFragment.
FragmentManager fm = getSupportFragmentManager(); RegisterAccountDialog dialog = new RegisterAccountDialog(); dialog.show(fm, "fragment_edit_name");
A good tutorial here
Upvotes: 1
Reputation: 938
You can use DialogFragment. You may refer to this or this tutorial
Upvotes: 1