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
-
0
votes0
answers122
viewsPerform action by clicking a button on another tab
I have two tabbed activity,I need a program to execute a code snippet whenever a button is clicked on another tab, but this excerpt cannot be Static! How do I do it? Here is the code that has to be…
-
0
votes0
answers125
viewsFragment updates when I select data in Firebase
I have 3 fragments inside a display pager and, whenever my database changes, it restarts the fragment. Tabadapteradvertiser class package com.example.fernandosilveira.findpromotion.Adapter; /** *…
-
0
votes1
answer313
viewsEdittext with same size Android
I’d like to leave my components <EditText/> the same size but I’m not getting it. <?xml version="1.0" encoding="utf-8"?> <ScrollView…
android android-studio android-layout android-fragment android-activityasked 7 years, 2 months ago User1999 864 -
0
votes3
answers129
viewsHow to make lists and cards equal to Trello
I need to make those lists with equal cards and used by Trello, with scrolling to the sides. What is used to do that?
android android-fragment android-recyclerview trelloasked 7 years, 2 months ago Lucas Brugnera Martinelli 11 -
0
votes1
answer126
viewsFragments in Tablayout’s Viewpager disappear on the second call
Come on! I have an app that has a Drawermenu (Sliding Menu), when clicking on the Edit Profile item, calls a new Fragment (Editfragment.class), up to there beauty, in that Fragment has a Tablayout…
-
0
votes1
answer431
viewsFragment within Viewpager calls no method
I have an activity (MainActivity) containing a PagerFragment who owns a ViewPager. On the pager I have 4 different tabs. Within each tab I own one Fragment 1 which can be replaced by using the…
-
0
votes0
answers28
viewsHow to print a custom Arrayadapter in a Ragment?
I am using a Drawer menu in my Android application and I need to print a list in Ragment by clicking on the side menu item, how I create a custom Arrayadapter and how I invoke it in Ragment?
-
0
votes0
answers589
viewsHow to pass data from Activity to Fragment
I’ve seen some posts about but I couldn’t figure out how to pass a string from one activity for a fragment I got the main: public class MainActivity extends AppCompatActivity implements…
-
0
votes0
answers35
viewsProblem in the Fragment
I have a class that uses fragment, but I’m having trouble calling one of these activity. When I do it for my own App. I want to click on the fragment MsgFragment. Below follows the main class and…
-
0
votes1
answer79
viewsStart an Activity from an item in the bottom navigation (menu bar)
I have the Activity main and a bottom bar navigation with 4 items. When I start the application, it starts, shows the Activity of the first item. I wanted to make it "start" from item 3. Is it…
-
0
votes1
answer185
viewsExpandablelistview - change background color of header title group
I need to change the background color of my Expandablelistview header group to a green color. Anyone have any ideas? Expandablelistadapter public class ExpandableListAdapter extends…
android android-layout android-fragment android-activity android-adapterasked 6 years, 8 months ago Wallace Baldenebre 114 -
0
votes1
answer127
viewsHow to fix a Bug with loading a Fragment within another Fragment?
I have a Mainactivity with Navigation Drawer, and all the items in this browser opens in Fragments. When starting the application I load the home page as follows:…
-
0
votes0
answers41
viewsLoad Fragments on part of the screen?
I wonder if it is possible to type a tablayout system only in part of the screen. ex: Where green, blue and orange are the buttons of the Tabs, and the red part would be the loaded Fragment, so by…
-
0
votes0
answers42
viewsError adding Pageviewadapter to Google Maps Android API
It has three (3) buttons and a (1) tab with two (2) buttons on the map, like this that I add the code to create the Pageadapters I get error and I don’t know how to solve. ERROR: 03-15 03:50:23.990…
-
0
votes1
answer54
viewsChange visibility
How do I change the visibility of a layout that is in another Active? I want to do this by clicking on an image.. I know how to use the method onClick. only lack the imagination of how to change…
-
0
votes2
answers437
viewsHow to place Mapactivity in a Fragment
It is so, I have a Mapactivity, but I would like the map to be in a Fragment. How can I do this? I created a Fragment, implemented the methods of Mapactivity created by Android Studio, but I come…
-
0
votes1
answer204
viewserror: incompatible types: Mapsfragment cannot be converted to Fragment
I am trying to add the Google Maps API fragment to the main project screen error: incompatible types: Mapsfragment cannot be converted to Fragment part of the code: fragmentManager =…
-
0
votes2
answers64
viewsWhat kind of database to use and how not to create many activities?
I intend to create an application, which will use barcode recognition, this barcode will lead to a screen on the medicine, the part of the database do not know which to use, because I never used,…
-
0
votes0
answers1073
viewsLoad an Activity inside a Fragment with tabHost
I’m starting with the android studio reading some things and watching some videos on youtube, basically what I intend to do is a calculation program to make my life easier in my service, some simple…
java android android-studio android-fragment android-activityasked 9 years, 4 months ago Túlio Barata 11 -
0
votes1
answer13
viewsKotlin setting up font within Fragment
There I am with a doubt, as I do to, modify the source from within a Fragment? tvAgradecimento.setText("Teste") tvAgradecimento.setTypeface(Typeface.createFromAsset(tvAgradecimento.context.assets,…
-
0
votes0
answers26
viewsClick on the Recycleview Item
I have a project and use the Navigation Drawer As layout, and inflate all fragmentos, well there was the need to have RecycleView, in it I get the result done by a select, only I also need it to be…
android android-studio android-layout android-fragment android-adapterasked 5 years, 6 months ago Ari Melo 131 -
0
votes1
answer24
viewsListfragment Android
Today using a Fragment to solve a problem, I saw that there is a class called ListFragment but what does it do? What’s the difference with a Fragment? When should I use the ListFragment when should…
-
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
answers11
viewsUsing Mobileads.initialize in onCreateView
Hi I’m developing an app and I wish to advertise on it, only I’m having a question that’s starting to become a concern, My app has a navigation bar and I use fragments instead of activitys and every…
-
0
votes0
answers59
viewsPass Actionbaractivity to Fragments
For me to use an acitivity in navigation Rawer a Activity precisa ta extend Fragments, e a minha ta extend action bar And in this action bar, I have the codes of a remote database, how do I put the…
-
0
votes0
answers60
viewsAttempt to invoke virtual method on a null Object Reference Fragment Asynctask
I’ve been at this for days and I still don’t understand why this mistake, I have a Asynctask who takes a Urls of a database I want to take the url and define the imageView gives an error on this…
-
0
votes1
answer737
viewsCreating a datepicker Android Studio
I’m wanting to create a datepicker as image below. But when I create one, it gets that way. Msm when I use some example that creates one according to the first image, it ends up being equal to the…
-
0
votes1
answer153
viewsError inflating class Fragment using maps
When I run my app, after selecting the event that directs to a activity using maps, it ends with Fatal Exception. luizugliano.com.br.lugaresfavoritos.Mapsactivity}: android.view.Inflateexception:…
android google-maps android-fragment google-maps-android-api-2asked 8 years, 12 months ago Luiz Henrique Ugliano 651 -
0
votes1
answer44
viewsHow to do in Wizzardpager, build a Fragment according to user’s choice?
I’m using the Wizzardpager based on this here. But what I want is basically the user chooses the sex of the person, and passes to another screen of Wizzardpager where in this, will choose her…
-
0
votes1
answer111
viewsAndroid Dev. Null Pointer when accessing a button of a Fragment by main Activity using set contentview
I made the layout of an application where I use the android menu. Menu is on main Activity: @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The…
-
0
votes1
answer37
viewsPassing information between Framents on Android
Hello, Please, I need help. I’m trying to use the Android Studio template to make a simple application that in a Fragment (Pegavaloresfragment) in the onCreateView method takes an option of a…
android-fragmentasked 8 years, 6 months ago Moura 1 -
0
votes0
answers33
viewsCall error
I’m using the Fragment and making adaptations, as in getIntent() ... Inserting getActivity() as was explained by a user, in other times that was informed was useful and worked, but this time an…
-
0
votes1
answer176
viewsWhen navigating on Fragment screens and returning, the screen turns white
have in Mainactivity 3(three) Fragments (Homefragment, Channelfragment and Searchfragment), with change made through tabs with click only. Inside the Homefragment I have 2 (two) more Fragments…
-
0
votes0
answers84
viewsAsynctask and Fragments
Hello, I’m new to development and have some questions. I have to implement a new layout, where: I converted the activities that load the data into fragments; In a new Activity the graph fragment is…
-
0
votes1
answer642
viewsHow to call a method that is inside my Fragment through the onclick of a button that is also inside the Fragment?
How to call a method that is within my java Fragment through the onclick of a button contained in the same Fragment? Follow code: public class Fragmentminhaconta extends Fragment { @Override public…
-
0
votes1
answer292
viewsSwitch to Fragment by clicking the button inside the Fragment
I have an Activity that has an empty Linearlayout that only serves to 'host' the Fragment. This Linearlayout (called layoutFundo) is the argument of Fragmenttransaction to which one of several…
-
0
votes2
answers738
viewsUpdate of Fragments Tabs!
I have two Tabs in my App, composed of fragments. The first is a form that saves the data in the database. The second is a list that retrieves that data. I would like to know how to update my List…
-
0
votes1
answer286
viewsCreate a Marker at the current Maps position with Fragment
Hello, I need to put a Marketer in my current position and show on Google Maps, but as I am using Fragment the setMyLocationEnabled method does not work, I have already gone after the internet on…
android google-maps android-fragment google-maps-android-api-2asked 8 years, 1 month ago Carlos Vicente 23 -
0
votes0
answers39
viewsHow to generate Fragments automatically?
Hello, I am developing a project where the user will create questions in the backend, and I will have to receive them through an API, generating them one per screen on android. What I need to know…
-
0
votes1
answer370
viewsHow to use Recycleview on fragment ?
I don’t know if I asked the question correctly, but let’s go there who can help me thank :) this is my second Mainactivity, I am making an application with navigation Drawer and in it to make the…
-
0
votes1
answer58
viewsHow to deal with Location services in fragments
I’m creating an app (Android) with two fragments, one with a list of addresses and the other with a map pointing to these addresses. Vertically, they are sliding tab and horizontal, they are side by…
-
0
votes0
answers24
viewsImplement onClickListener method in a Fragment
I am developing, in Android Studio, an application about music. In this application, I have two Fragments: Home Fragment and Genres Fragment. Inside Genres Fragment, I have 4 Imagebutton and I want…
-
0
votes1
answer311
viewsFragment Transaction - Error commit already called
I have this method that checks the Fragment inflate in my view: private void startFragment(int code) { switch (code) { case 1: fragmentTransaction.replace(R.id.fragment, MesAnterior.newInstance(0));…
-
0
votes1
answer74
viewsProgramming Android Studio
Error in Second "public class", what can I do??? If anyone knows, please say. Thank you. package com.example.hsantos_98.artofthefire; import android.app.Fragment; import android.os.Bundle; import…
-
0
votes0
answers230
viewsError when trying to add a Fragment to a project in android studio?
I created a project and did not put anything in it, the same is zeroed, only with that textView "Hello World". The problem appeared when I tried to add a Fragment (with a + 1 button) to the project:…
-
0
votes1
answer55
viewsFragments setArguments and getArguments error
I’m trying to pass some information from Activitymain to a fragement but android is complaining, in Activitymain I pass the values so: if (f_caixaTexto== null) { f_caixaTexto = new…
-
0
votes0
answers217
viewsRepeated items with different amounts in a Listview
I have a Listview (lsvProduct) with some items that comes from a request and an Edittext of amount that the user can change (by default, I bring the value of 0). By adding this item, I send it to…
-
0
votes3
answers803
viewsHow to add a Searchview to an Android Fragment?
I created a Fragment and I’m trying to add a SearchView in that Fragment, but unsuccessfully, I haven’t found any consistent examples on the Internet and Google documentation provides only…
-
0
votes2
answers809
viewsSend data from a Fragment to an Activity
Good Morning Everyone I have a Fragment containing a listview where I list the data coming from a webservice. In the onclick method I have the following code where I pass some values to another…
-
0
votes1
answer404
viewsBack to Canvas Ragment
Good night, you guys. I have a main and 3 classes Fragment. By accessing the main, I can slide to each Fragment correctly. However, in each Fragment I have functionalities. If I access one of these…