Most voted "android-fragment" questions
It is one of the great novelties of the Android API, which emerged after the version Android 3.0 Honeycomb, thanks to the arrival of tablets in the market.
Learn more…321 questions
Sort by count of
-
1
votes0
answers17
viewsDragevent x Motionevent android studio
Hi, I would like a help: I need to insert in my apk the effect of dragging and playing an item (image, text, icon) in the trash, equal to the function that is already configured in s smarthphones or…
-
1
votes1
answer394
viewsEvent onBackPressed
I have a project with Navigationdrawer, on the main page I have a menu, and on the other fragments I inflate, only when I press the back of the navigationbar 'back button of the mobile phone', it…
-
1
votes0
answers107
viewsUpdate UI during print screen process
I have a Activity and several Fragments in it and, in a Fragment, I have a list of images. I want it, through a floating button, to print all the images without having to change the image that…
-
1
votes1
answer608
viewsCapture selected Recyclerview item to another screen
I have my search screen. When typing, it brings the search result. The result is shown in a recyclerview. My Recyclerview was modeled with some textviews and an image. I wanted when touching the…
android android-fragment android-recyclerviewasked 5 years, 2 months ago Luciana Freire Efelipe Correia 27 -
1
votes0
answers135
viewsAndroid Fragment with Textwatcher - does not work
Good morning! With the help of the staff, I made a calculation scheme that when typing the value in an editText1, another editText2 is updated automatically, and vice versa.. It’s just a test…
-
1
votes1
answer1233
viewsHow to adjust screen according to Android virtual keyboard?
I would like to know how to resize the screen according to the display or not of the Android Virtual keyboard, Evernote’s home screen style, that when the keyboard appears the image decreases and…
-
1
votes1
answer289
viewsOne Fragment’s onCreateContextMenu method calls another Fragment’s onContextItemSelected method
I have a Fragmentactivity that calls its Fragments in the shape of tabs (Viewpager). In two of these fragments the methods were implemented onCreateContextMenu and onContextItemSelected. In this…
-
1
votes1
answer65
viewsHow to rebuild the XML of a Fragment layout when it is expanded?
I have a screen with a Fragment, that without being expanded, it just shows the user and password field and the sign up button, and I wanted that when I expanded it, fields like name, date of birth,…
-
1
votes1
answer182
viewsHow to call an id hosted in the Activity layout extended by Fragment?
Well, I’m developing an app, in which if you have a navigation Drawer and in this navigation I put to open each item in a new Activity, and in each acitivty will have a layout, right so far okay.…
-
1
votes1
answer100
viewsHow to adapt an Activity to Fragmentactivity
I’m making a NavigationDrawer, and then I have to make some adaptations, because I’m extending Fragment, but I need to use int’s for Activity to work, I tried calling inside OnCreateView the…
-
1
votes1
answer779
viewsNavigation Drawer - back button
I’m trying to get the button back or back from android keep the sequence of Fragments that I’m rendering as chosen option in my side menu (Navigation Drawer), but I’m not succeeding, it always…
-
1
votes1
answer986
viewsHow to change Activity within a Button Ragment?
I have a simple App, has two areas, one with the Fragment and another with a Button Group (Imagebuttons) How to do so that by clicking the buttons I can change which Activity will be loaded in…
-
1
votes1
answer3678
viewsHow to send data from an Activity to a Fragment?
As you can see in the code below I can send data from one Fragment to the other and tbm from one Fragment to Activity but I’ve tried everything to send from Activity to Fragment but I’m not getting…
-
1
votes1
answer58
viewsStatic objects in Activities with View Pagers
I have an Activity with a view pager, and this one controls three fragments, F1, F2, F3. The F1 fragment shows user-added items, the F2 fragment loads all items from an external server, showing them…
android android-fragment static android-context android-recyclerviewasked 8 years, 2 months ago Guilherme Ramos 343 -
1
votes1
answer512
viewsParametric passage from one fragment to another
I don’t know how to work with two fragments, I looked for some things here but I didn’t know how to look right. Of Activity for another I use the Bundle and it works, but I don’t know how to use it…
-
1
votes2
answers832
viewsPress the button of a screen that is a Fragment and go to another Fragment. How do you do?
I have a class like Fragment and would like when the user clicks the button to go to another screen that is Fragment.. how can I do this? public class AlertaFragment extends Fragment { @Override…
-
1
votes0
answers248
viewsFill Spinner and Listview - Fragment
I am developing an application with Fragment. I have two Fragments, where in one there is a Listview and in the other a Spinner. Listview and Spinner are populated with data coming from the…
-
1
votes0
answers70
viewsMethod only works when minimizing/maximizing app
I’m developing an app for TCC using Google Places API. A part of the code returns the locations/establishments next to the user. However, when I run the app and enter the responsible class I have no…
-
1
votes2
answers1372
viewsWhen changing Fragment, the previous one is visible below the new one
I’m using Fragments instead of Activity, only when I call the second Fragment with the replace method, it doesn’t completely overlap the previous Fragment, it’s on top, but the drawing of the other…
-
1
votes1
answer39
viewsApplication closing unexpectedly when sending post request
Well I’m developing a screen using the holder view and in it I am sending a JSON to the server, but it has been a problem. By clicking the send button it simply closes the application, and in the…
-
1
votes1
answer453
viewsHow to call a method in Fragment via listview Adapter
I have a fragment that has a listview inside it and inside lisview has a button. The button has to delete the listview item I have already made a method within onactivitycreated, but gives error…
-
1
votes2
answers245
viewsCannot Resolve Method isChecked()
I am trying to use the isChecked() method but is giving the message "Cannot Resolve Method Ischeked(). Can anyone help me? @Override public View getView(int position, View convertView, ViewGroup…
-
1
votes1
answer77
viewsSwitching Fragements without loading the whole screen
I have a problem with my studies, when I change Fragement and then I go back to the source Fragment the data is loaded all over again. And since data comes from the web, it takes time and precious…
-
1
votes2
answers237
viewsRadiogroup in Listview does not maintain selection after scroll
I have a Listview with some information and within it I have a Radiogroup, but when I scroll the screen all my checkbox are unchecked because the listview is creating this checkbox again. I need my…
-
1
votes2
answers92
viewsKeep the item focus Bottomnavigationview clicked after rotate screen
I have a problem when I rotate the screen. I have the following structure: A Homeactivity that handles clicks on Bottomnavigationview (there are 4 items) Each Bottomnavigationview item loads a…
-
1
votes2
answers920
viewsHow to know which Fragment is being displayed
My app has an Activity that controls the inclusion of Fragments. Follows: public static void adicionarFragment(Activity activity, Fragment fragment){ FragmentManager fragMgr =…
-
1
votes1
answer164
viewsTake data from 2 Ragments by clicking an Action Button (Toolbar)
Come on! I was looking on the internet about how I could get the values of Edittext of 2 Fragments by clicking on a Action Button of Toolbar, but I didn’t find anything related. What I found, was…
-
1
votes2
answers1441
viewsHow to call a method of a Fragment in an Activity?
I need to use a Fragment method within an Activity, but I can’t pass a reference to that Activity. Can anyone help me? That’s the whole idea: public class MinhaFragment extends Fragment{ ...…
-
1
votes1
answer95
viewsproblems with Float Action Buttom (speedDial) - Android
Hello! I found a lib of a float action with speed dial and I’m trying to implement it in my Android project, but I’m not able to interact with the Float Button... follows the code of the fragment…
java android android-fragment android-recyclerview floatingactionbuttonasked 7 years ago Mikhael Araujo 333 -
1
votes1
answer171
viewsError while creating android studio Fragment
I’m doing an android course that has navigation in bars and for this is used Ragments, I did the video way however tabs appear but the content of Ragments no, in the console I have this error:…
-
1
votes1
answer132
viewsHow to initialize the components of a layout in the onCreate of a Fragment?
I created a Fragment to show a list of items, but I need to initialize two components a listview and a Progressbar on onCreate but I don’t have the reference of the layout file they are. How do I…
-
1
votes1
answer237
viewsWhy inflate a Layout in Fragments instead of setting one already ready? Ex: setContentView(R.layout.activity_example)
I’m learning about Android and would like to better understand how this part of the system works. Instead of inflating a layout, it would not be simpler to do as when creating an Activity, for…
java android android-layout android-fragment android-activityasked 6 years, 10 months ago Nakamoto 1,341 -
1
votes1
answer174
viewsHow to use Appcompatactivity functions within a Fragment?
I have an Fragment and need within it some Appcompatactivity functions, as I implement both in the same class? It’s like this: public class clientes extends Fragment { I’ve tried to: public class…
-
1
votes2
answers125
viewsGoogle Maps returning Latitude and Longitude as zero and problems when placing the Marker
I’m trying to use Google Maps, and settar a location in it (pulling the user’s Latitude and Longitude). It pulls and displays on a Toast, but it does not Setta this in the onMapReady method and not…
android google-maps android-fragment google-maps-android-api-2asked 6 years, 9 months ago Wallace Baldenebre 114 -
1
votes0
answers100
viewsInsert additional data into Firebase
I am developing an app that is composed of 3 fragments of registration, here given the example of A, B, C, and B and C is dependent on A. What is the best way to enter the completed data in B and C…
-
1
votes1
answer282
viewsNullpointerexception when using setText for a Textview in Fragment
I am creating a Fragment where I have in one part the map and in another an object of Retrofit, where I get date and time from a server. The error occurs inside the Retrofit onResponse call, where I…
-
1
votes1
answer133
viewsProblem with updating a Fragment
I am learning Android and while trying to develop an app I came across the following situation: I have an Activity that has two Fragments: ReminderListFragment and FilterListFragment. The first…
-
1
votes0
answers12
viewsAndroid - How to get Extras in an Innerfragment(Nested Fragment)?
How to get a Extra within Fragment nestled in another Fragment? I have an Activity with the following Layout: Activity (que infla um){ //Aqui a activity infla 3 Fragments para criar um…
-
1
votes1
answer139
viewsHow to view a Menu by clicking on the Bottomnavigationview item
My application this way: I need a menu to appear when I select the fourth item: The code of my Activity Main: package br.com.friendlychat.navigationbottombar; import android.os.Bundle; import…
-
1
votes1
answer53
viewsInsert multiple Markers into Maps
I found a code here on the site, I put in my project but it didn’t work, anyone knows how I can solve? The method below is called in onViewCreated() Note: I am using the Map inside a Fragment, it…
java android android-studio android-fragment google-maps-android-api-2asked 6 years ago Elailson Silva 11 -
1
votes3
answers45
viewsCiclo Activity android
My app has 4 Activitys. When I get to the Activity number 4 user has option to return to Activity number 2 that this in onStop(). The problem is that when I go back to Activity number 2 she runs…
android android-studio android-layout android-activity android-fragmentasked 5 years, 8 months ago Paulo Castelo 71 -
1
votes1
answer320
viewsDestroy fragment on return
I have a NavigationDrawer with many menus on Navigation all open as fragment, when I open a fragment and return it returns to the home screen and if it comes back again close, blz ta correct. But if…
-
1
votes0
answers22
viewsError using startActivity on Fragment
I want the Button (tutorialeme) that is inside the "emergency" Ragment to have a CLICK action, and in this action I want him to call the Activity "tabbed_warning", the error is in Intent,…
android android-activity android-fragment android-xmlasked 5 years, 4 months ago Matheus Vidigal 33 -
1
votes0
answers68
viewsSomeone could tell me why the Google Maps API is not generating the map in android studio 3.5
Code of the Homefragment public class HomeFragment extends Fragment implements OnMapReadyCallback { public HomeFragment(){ // Required empty public constructor } GoogleMap mMap; @Nullable @Override…
-
1
votes0
answers38
viewsError while removing Listview item - Android
Well, I am working on a system that puts some items in a list, in sequence, using a Dialogfragment with the list of added items I would give the option to remove these items, the problem is there. I…
-
1
votes1
answer146
viewsPlacing findViewById on the fragment
I am trying to put a webView inside a fragment that refers to webView that I put inside the xml for the findViewByIdmethod Fragment only works if I extend an Activity class. Is there any way I can…
android android-studio android-fragment webview android-webviewasked 5 years, 1 month ago renan silva das neves 159 -
1
votes0
answers98
viewsQuestions about using Appbar + Toolbar + Fragment - Android Studio
Hello, I have prior knowledge of Java but I’ve just started programming for mobile on Android Studio, someone would tell me if there’s any way to use Appbar + Toolbar (for the sake of design itself,…
android android-studio android-layout android-activity android-fragmentasked 4 years, 8 months ago Davi Massini 26 -
1
votes1
answer59
viewsAndroid Studio onActivityResult does not return
I am showing the pop-up asking it to activate the GPS then use " onActivityResult " to catch the result, only it does not return anything. Researching I saw several similar problems but nothing…
-
0
votes1
answer134
viewsUse of Fragments
I’m a beginner on android. I’m learning using the video lessons of Professor Neri, but in his video lessons (android 2.2) did not use Ragments, but in my projects I’m creating he always creates with…
android-fragmentasked 10 years, 4 months ago Hermes Vitor 1 -
0
votes1
answer332
viewsGood Practice Fragment and Service
So personal the question is the following.. I have an Activity connected to a service. I want to start a fragment and that fragment will perform functions within the service. What would be the best…