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
-
2
votes1
answer94
viewsHow to get the Listview reference of a Listfragment?
I’m with a ListFragment trying to access the ListView in which the Adapter inserted the objects, but the findViewById is returning null, anyone has any idea? The XML Fragment code: <?xml…
java android listview android-fragment android-adapterasked 7 years, 6 months ago Danilo Nadolny Vizentainer 23 -
2
votes1
answer287
viewsError calling getLayoutInflater() inside a Fragment
I’m having a problem creating a custom window. The idea is to have a balloon that presents an image and some basic information about a location, with a link to another activity in greater detail.…
-
2
votes1
answer1001
viewsHow to open a Alertdialog?
Well, I’m learning now about Fragments. From what I understand, fragments are components, something you want to repeat on several screens, without having to keep creating several classes or…
-
2
votes1
answer3044
viewsHow to get the context in a Fragment?
What should I insert into a method that needs the context argument in this Fragment ? public class Tab1tests extends Fragment { private ViewPager mViewPager; private…
-
2
votes1
answer1838
viewsError while performing findviewbyid
Hello, I want to find the id of two Textviews, but they are returning NULL. Follows my code: private TextView nomeUser; private TextView cargoUser; @Override protected void onCreate(Bundle…
-
2
votes2
answers261
viewsWarning:(40, 5) Do not place Android context classes in Static Fields; this is a memory Leak (and also breaks Instant Run)
I’m coming across this warning from Android Studio. Warning:(40, 5) Do not place Android context classes in Static Fields; this is a memory Leak (and also breaks Instant Run) I have a button that…
-
2
votes0
answers398
viewsHow to modify the Navigation Drawer to call an Activity
People I created a navigation Drawer by google gallery (Navigation Drawee Activity) and would like to modify it for when I click the menu instead of calling a file extent Fragment call a normal…
android android-layout android-fragment android-activityasked 6 years, 11 months ago Maria Eduarda 63 -
2
votes2
answers826
viewsReturn to a previous Fragment from any Fragment
I have a main activity in which are called some Fragments: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);…
-
2
votes1
answer112
viewsUpdate fragment with Listview
I intend to "refresh" a fragment (fragment30.java) that displays the records of an Sqlite table after the deletion of one of these records . The records shall be submitted using a Listview…
-
2
votes2
answers217
viewsGo back to the previous Fragment by clicking the Back Phone button?
I’m trying to implement the functionality of going back and appearing to me the fragment in which I was previously. That is: fragment1, Fragment 2, Fragment 3 and Fragment 4. I can go from Fragment…
-
1
votes2
answers1309
viewsError calling method on fragment
My code below was to do a simple task, when clicking the button change to another screen, but is giving error: Cannot make a Static Reference to the non-static method chamaCadastro() from the type…
-
1
votes1
answer3881
viewsManage back button between Ragments
I’m working on an app for the college where I’m using Fragments for all my screens, for reuse purposes. The problem is that I cannot control the behavior of the back button between the Fragments.…
-
1
votes1
answer451
viewsUse interface implementation in a Fragment
I’m trying to implement an interface I created within a fragment, but I’m not succeeding. My fragment is being defined with the following code: package fragments; import…
-
1
votes2
answers2043
viewsHow do I implement ?Sign in with google' in my android app?
I’m having difficulty integrating 'Sign in with google' in my app, I followed the documentation, not working out. any hint and help?…
-
1
votes1
answer1836
viewscall a main Activity method from a Fragment button
I am using a standard android Activity, the "Navigation Drawer Activity", and There is a button in the navigation bar public boolean onOptionsItemSelected(MenuItem item) { if…
-
1
votes1
answer231
viewsWhen to use onCreateView() vs onActivityCreated()?
I wanted to know the questions below: -When using onCreateView() vs onActivityCreated()? -Which of these two methods should I use to fill a listview with Adapter?
-
1
votes2
answers561
viewsCreate menu button at the bottom in Google maps v2 android
How to create the Menu button equal to the Maps App. Below is an example in the red square. Someone could set an example ?…
-
1
votes2
answers1734
viewsHow to pass data from a Pager/Fragment to another Activity?
I’m creating an Activity that possesses Swipe Views (Viewpager) and I would like to know how to pass data from Ragment to another Activity, since static methods are always requested. For example,…
-
1
votes1
answer3184
viewsHow do I adjust my app to the screen size of multiple devices?
Good afternoon, I am developing an application in Android Studio and it is well adjusted in my Motorola Moto X 2nd Generation. However, in my Samsung Galaxy Note 3, Motorola Moto E and Motorola Moto…
-
1
votes2
answers355
viewsChange Status Bar to transparent in a Fragment within an Activity
I have a Activity which has a theme for its Status Bar, but it has an influence on a Fragment I want another color in the Status Bar. Is there any way I can change the color of the Status Bar just…
-
1
votes3
answers182
viewsHow to instantiate an Activity with Edittext fields without being automatically selected?
Developing an Android application, I came across a problem, I have an Activity where there are editing fields (Edittext) in xml, and when I instate it, the first Edittext field, is selected and the…
-
1
votes1
answer858
viewsUpdate Fragment UI after coming back from Backstack
Maybe the problem is simple, but either way, I’m stalling to do it. I know I would have been able to do this through interfaces, but I don’t want it that way. My app has only one Activity that…
-
1
votes1
answer98
viewsError: The method getFragmentManager() is Undefined for the type Activitieslistadapter
What do I call a Fragment from a Basedapter? I will call him at the click of the button, and I must also pass some information. I’m trying to call it that: Fragment fr = new Fragment();…
-
1
votes1
answer84
viewsShow an application A within the Fragment of another application B
In my app, when the user clicks Add Contact I call the Contacts app using a Intent. But instead, it would be possible to open a Fragment whose content would be the Contacts app itself, i.e., show…
-
1
votes0
answers287
viewsFragment does not appear in a Toolbar with Tablayout
I am trying to show 2 list layouts in the same Activity using Viewpager, but for some reason the layouts are not being shown on the application screen (they are blank), however, when debugging,…
-
1
votes1
answer121
viewsUse Notificationmanager in a class that is not Activity
I’m having a little problem and I’m not making it. The problem is this: I have a Fragment in my app, and I want to fire a notification from it. The line I’m having problems with is this:…
-
1
votes1
answer791
viewsTake data from 3 Ragments
Good afternoon, I am developing an android application and in it I have an Activity with 3 Fragments(tabs), where each one contains a part of a form and in the last I have a save button. My…
-
1
votes1
answer357
viewsSave the Shard’s state?
In a simple app I have Fragments and need to save their state, so that when the user returns from one fragment to the other, the typed text, chosen number, checked box, etc... suggestions ?…
-
1
votes2
answers208
viewsUsing Dialog in a Fragment
I implemented the Dialog method but is giving error and I am not able to solve, I would like a help follows my class public class Iniciar_Host extends Fragment implements…
-
1
votes1
answer43
viewsValues of Activity fields are deleted after event in Dialogfragment
I have an Activity that has some text fields. Two of them open a Fragmentdialog when clicked. Dialogs display a list of values that are taken to the Activity via Intent when selected. When this…
-
1
votes2
answers92
views"Refresh" from Fragment co listview
I have a Fragment that, clicked on a RadioButton, a route is calculated, after this route calculation, a ListView with the results. By clicking on the other option of this radiobuttom, the routes…
-
1
votes1
answer351
viewsAndroid Listview customized in a Fragment
I have an app layout was made in tabs and in one of them I would like to implement the ListViewcustomized, but I could not because the JAVA class tab extends the class fragment and to make the list…
-
1
votes0
answers51
viewsIs it possible to receive a null object from another fragment on Android?
The problem is this: I have two fragments, the first has a list, which if clicked, sends an object to be edited in fragment B. In fragment A there is also an inclusion button that when clicked opens…
-
1
votes1
answer63
viewsgetView is not being called but getCount has items in Listview
I’m having a problem with a Listview that isn’t loading the values. That’s my situation: I have an application that at a certain point opens a Tabbar with 2 Fragments and inside one of these…
-
1
votes1
answer219
viewsCalling screen with Fragment
I created a screen with a list view based on Fragment native android studio, but I did not find solution to "call" this screen from a button. public boolean onNavigationItemSelected(MenuItem item) {…
-
1
votes1
answer54
viewsWhich type to use to store values that are in an Arraylist<> in an Sqlite table?
I have the following table in Sqlite: db.execSQL("create table amc(_id integer primary key autoincrement, nome text not null, contratada text not null, tipo text not null, data text not null,…
-
1
votes1
answer183
viewsImplement screens in list
I’m working on my first project with ListFragment searching the internet in tutorials and even in the online course I’m doing. When the onListItemClick he sends a Toast to screen, but I want you to…
-
1
votes1
answer63
viewsProblem with Fragment
I created a Fragment and I’m trying to call it when I click on a button, but it gives an error and it appears in the console com.ample.Gustavo.easypasse.Reloade@30d409a0 must implement…
-
1
votes1
answer468
viewsAndroid Listview equal to Instagram
I’m developing a project in Android Studio, the project screens are all made in Fragment, I’m using the Material Design followed the tutorial here, and would like to make the main screen a Listview…
-
1
votes1
answer51
viewsDo I use Activities or Fragments?
I’m with a project to develop a guide app for games that will show images through a server and the guide will be pdfs files downloaded and opened by the app. The flow would be: Console list…
-
1
votes0
answers90
viewsScrolling effect with recyclerView
I am working on an application where I have a Fragment with a title and a recyclerView. This Recycler view is divided into sessions (example, pizza, soda), each session has a header and the items…
-
1
votes1
answer279
viewsandroid.widget.Linearlayout cannot be cast to android.widget.Listview
When running my application, this error appears: 05-28 05:33:33.773: E/AndroidRuntime(28824): java.lang.RuntimeException: Unable to start activity…
android android-layout android-fragmentasked 9 years, 5 months ago Vinícius Venancio dos Santos 329 -
1
votes0
answers41
viewsProblem calling Class Activitity
I have a class I intend to call another class through a click on one of the fragments, but it is not responding when calling the other Activity gives an error in the app and application to work. I…
-
1
votes1
answer231
viewsListview Fragment
The list is loaded into the Fragment with the selection of the Actionbar menu item. However, when I click on a different tab than the one that has Fragment with the list, and return to the tab with…
-
1
votes0
answers50
viewsError executing Sql Server query with jtds
I am like a strange situation, my code works perfectly in my environment. No tablet client does not work... The only difference is that my tablet has the developer option enabled. I created the…
-
1
votes0
answers299
viewsHow to add a Menu in a single Fragment?
I have 3 Fragments and all of them in one Activity Mom. I want the following menu: <?xml version="1.0" encoding="utf-8"?> <menu…
-
1
votes0
answers49
viewsExample of Navigation Drawer
How do I add a Navigation Drawer to a Activity? I searched several sites but only found the projects to download and not the explanation of how to do it.
-
1
votes2
answers922
viewsLoad Map in Fragment - Android
I’m creating an app with 2 tabs in Swipe, loading Fragments. Since the first is a Listfragment (which is ok), the second should load a map, but, after I tried to insert, crashes the application and…
-
1
votes0
answers183
viewsAndroid Complex layout using Fragment
I’m having trouble creating a footer (footer). The problem is in the horizontal position of the tablet where I have two framelayout and need to include the footer occupying all the bottom (below the…
-
1
votes0
answers157
viewsError: android.view.Inflateexception: Binary XML file line #0: Error inflating class <Unknown>
Whenever I run my app on some devices (In the ones that received this error, API was 21. In the others with higher API works without errors), this error message appears that I can’t decipher. It…