Questions tagged as 'fragment'

1
answer

How to add Onclick to a fragment?

I'm trying to add onclick to my fragment, but I'm not getting it, where is it wrong? @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { return inflater.inflate(R.layout.fragment_m...
asked by 11.12.2018 / 23:31
1
answer

How to transition to the previous fragment when you press the back button?

I'm having the following problem: I have an activity, in which I call a fragment as follows: FragmentManager fm = getSupportFragmentManager(); Fragment frag = new MyFragment(); FragmentTransaction ft = fm.beginTransaction(); ft...
asked by 07.08.2018 / 22:54
1
answer

How to use newFragment.show ()?

I'm having trouble displaying a calendar after clicking a button . Does not recognize newFragment.show(); public void secionarData(View view) { DialogFragment dialogo = new DatePickerFragment(); newFragment.show(this.getFr...
asked by 20.06.2018 / 20:04
1
answer

How do I call a component and its properties in the Fragment?

I needed to enter Fragment to execute this method Verifcar() on main Activity to check the condition and not show RecyclerView . MainActivity.Java public void Verificar(){ if(pref.getBoolean(Constants....
asked by 24.05.2018 / 15:44
1
answer

Why pass arguments to a Fragment using Bundle instead of a set method

I recently asked myself a seemingly simple question that I could not answer and found no concise answer. The question is simple: Why use Bundle instead of a set method to pass parameters from an Activity to a Fragment? For example: Case 1...
asked by 13.03.2018 / 19:59
0
answers

Fragments controls style different from DialogFragments

I have a fragment and a dialog fragment with spinners and editboxes, however the styles are different. The fragment is smaller, with no borders, only with a line at the bottom. The dialogfragment has borders and the edittexts background are whit...
asked by 12.11.2018 / 17:13
0
answers

Retrieve data from other fragments when clicking button?

I have a form with 3 Fragments, where in the last there is a save button, when I click on this button I need to get the data entered by the user in Fragment 1 and 2, get the data of the open fragment (3) and save for this I thought of using Sing...
asked by 29.10.2018 / 19:58
1
answer

How to create a custom ListView inside a Fragment?

Good Night I researched a lot about it, but I could not fully understand the concept. I have an Android application that uses Fragments. I need to insert a custom ListView with an image and several texts, but I'm not getting it to work....
asked by 14.10.2018 / 04:18
0
answers

Transition Fragments upon return

I have a DrawerLayout that controls my fragments. However I have the following problem: if I am in fragment A the corresponding menu item is highlighted, when selecting fragment b, the item is also highlighted correctly. However, when you click...
asked by 01.10.2018 / 21:00
0
answers

How to inflate the fragments according to the screen rotation?

I have 2 layouts and the fragment classes, one layout is what should appear when the screen is vertical, and the other is for when the screen is horizontal. How do I "inflate" one and "deflate" the other for when the screen rotation occurs and...
asked by 21.08.2018 / 22:03