Most voted "fragment" questions
20 questions
Sort by count of
-
2
votes1
answer103
viewsHow to transition to the previous Fragment when pressing 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…
-
2
votes1
answer700
viewsHow to add Onclick in a Fragment?
I’m trying to add onclick in my Ragment, but I’m not getting it, where it’s wrong? @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {…
-
1
votes1
answer320
viewsWhy pass arguments to a Fragment using Bundle instead of a set method
I recently asked myself a question, seemingly simple, that I could not answer and I did not find any concise answer. The question is simple: Why use Bundle instead of a set method to pass parameters…
-
1
votes1
answer140
viewsHow to call in Fragment a component and its Activity properties?
I needed that when I entered the Fragment he executed this method Verifcar() in main Activity to check the condition and not show the RecyclerView. Mainactivity.Java public void Verificar(){…
-
1
votes1
answer32
viewsHow to use newFragment.show()?
I’m having trouble displaying a calendar after clicking on a button. Does not recognize the newFragment.show(); public void secionarData(View view) { DialogFragment dialogo = new…
-
1
votes1
answer80
viewsFragment closes by clicking on Textview Kotlin
Save list! Next, I have an Activity where I call a Fragment using // ... val manager = supportFragmentManager val transaction = manager.beginTransaction() _Fragment = AcvtFragmentView() val args =…
-
1
votes0
answers20
viewsHow to create a button in a Fragment for android?
I created a button that aims to Random an image. However, the button and image are not appearing on android. The code I’m using is as follows:: ImageView imageView; Random r; Integer[] images = {…
-
0
votes0
answers73
viewsError in the Fragment
I’m trying to make a calendar for birthdays, but on Fragment where I put the calendar is giving an error that I do not know how to fix. Error 06-02 01:17:33.346…
-
0
votes0
answers73
viewsHow to disable the on Stop method?
I am developing an app and am using 3 Fragments in a slider layout. And when I slide from the first tab to the third tab, my first tab calls the onStop method and consequently, everything in that…
-
0
votes0
answers32
viewsTransition Fragments on return
I have a Drawerlayout that controls my Ragments. But 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…
-
0
votes0
answers101
viewsSave data when changing Fragment
I want to save the values that are on the counter for when I change from Fragment and go back to that, the values that I counted are there. I tried to use Savedinstance so that it did not work,not…
-
0
votes1
answer35
viewsBack button deletes Fragment in main Activity
Hello, all right? I’m making a server-going Fragment as a sort of menu cards on the initial interface. I made it every time the app opens It creates this interface inside a Constrainslayout, but…
-
0
votes1
answer887
viewsHow to create a custom Listview inside a Fragment?
Goodnight I did a lot of research on it, but I couldn’t quite understand the concept. I have an Android application that uses Fragments. I need to insert a custom Listview with an image and several…
-
0
votes1
answer37
viewsPassing the Parameters of a Fragment that uses json for another Fragment
I have a screen that searches by name through an Edittext. And when searching by name it brings me a Recycleview with its results. And when I touch an element of the result, it goes to a Fragment…
-
0
votes0
answers16
viewsClick button on one Fragment and go to another Fragment
Good morning!! I got a problem. on a button with click function I use the code: Fragmentmanager fragmentManager = getActvity(). getFragmentManager(); FragmentTransaction fragmentTransaction =…
-
0
votes0
answers34
viewsRecover data from other Ragments by clicking button?
I have a form with 3 Fragments, where at last there is a save button, when I click on this button I need to take the data entered by the user in Fragment 1 and 2, get the data from the open Fragment…
-
0
votes1
answer214
viewsFragment screen to call another screen Fragment
I’m in a fragment, and in that fragment I want to call another screen which is also a fragment. I’m using recycleview. If I try to call one activity, I can, but I can’t call a fragment. See the code…
-
0
votes0
answers12
viewsSend Arraylist from an Acttivity to a Fragment
Good afternoon, everyone, I am trying to send an Arraylist of an Activity to a Fragment that will use it in a Gridview, but I have not been successful. When clicking the button the Activity creates…
-
0
votes0
answers18
viewshow to take firebase data and put it into a textview?
I want to take the user data registered in Firebase and put them in a Textview, but I’ve tried several ways and none worked. Code of Profile Fragment: public class PerfilFragment extends Fragment {…
-
-2
votes1
answer30
viewsI need to call an Activity through a Fragment, I looked for some answers but they didn’t work
JAVA public class Contactofragment extends Fragment { Button btnMaps; TextView txtMaps; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {…