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
votes2
answers42
viewsOnlistitemclick not working on Listfragment
The Toast of the onListItemClick method never appears, someone knows what I did wrong? Code: public class TiposFragment extends ListFragment { private ArrayList<Tipo> tipos; private…
-
0
votes1
answer276
viewsOpening external website in android studio within a list item
Good need to open an external link for example: https:www.google.com However it should stay within a litem of menu list (side menu). To open the Fragments I use the position of the item, there are 7…
-
0
votes1
answer279
viewsHow to place a title in Ragment?
I have the code below, which calls a Fragment, in Activity Schedulesearch: @Override public void openFragment(int home, boolean search, boolean changeClickDirection) { if (home == 0) {…
-
0
votes1
answer703
viewsInsert Scrollview into all Activity
Hello, I need to insert a ScrollView throughout layout. But I’m not getting it. Follow my code. <?xml version="1.0" encoding="utf-8"?> <LinearLayout…
android android-layout android-fragment android-activityasked 7 years, 6 months ago Lucas Charles 127 -
0
votes4
answers645
viewsHow do I insert a button after a listview?
Hello, I need to insert a button right after my listview. I mean, when I finish sliding my listview will have a button at the end. I’m trying to do it this way: <LinearLayout…
-
0
votes1
answer272
viewsFloatingactionbutton does not work
My Floatingactionbutton does not work. In my application I have a Fragment and two tabs. In one of the tabs, floatingActionButton works, in the other not. This is the layout of the main Fragment,…
android android-layout android-fragment floatingactionbuttonasked 7 years, 6 months ago Flavio Luiz 81 -
0
votes1
answer417
viewsCalling a method of the class of the Fragment itself
Good afternoon, I have a Fragment that has the following XML <Button android:id="@+id/salvar" android:layout_width="match_parent" android:layout_height="wrap_content"…
-
0
votes1
answer625
viewsPassing Data from Fragments to Activity
I own an application with a main Activity and within it there is a viewpager with Fragments generated by a list and a floating button. What I want is that by clicking on this button I can return…
-
0
votes1
answer48
viewsExchange of information with Fragments
I have a CRUD to add users but I’m having trouble implementing the edit. User clicking edit wanted edittext to be loaded already filled. For that, I tried to implement something like: ImageView…
-
0
votes1
answer66
viewsError using Mainactivity method in Fragment
I am trying to use a method that returns a list, when using this same method inside the mainactivity where it was created everything works well, but when trying to access it in a fragment of the…
-
0
votes1
answer631
viewsReturn string in SQLITE query
I need to return a user’s name in an SQLITE query: I’m using the following code: public String verificarUsuario(String login) { try { String selectQuery = "select nome from usuarios where login = "…
-
0
votes1
answer135
viewsfetch all records from a sqlite column
I need to save in a list the names of the user table and save them in an Arraylist. I did as follows: public List<String> buscarUsuarios() { List<String> nomes = new…
-
0
votes1
answer385
viewsError while performing an SQLITE table creation
I’m trying the following mistake: android.database.sqlite.SQLiteException: no such column: np (code 1): , while compiling: SELECT _id, nome, email, np, tipoFunc FROM usuarios ORDER BY nome ASC at…
android android-studio sqlite android-fragment sqlite-studioasked 7 years, 5 months ago Lucas Charles 127 -
0
votes1
answer45
viewsApplication giving Crash on a button inside a custom Alertdialog
I am working with Alert Dialogs and I appeared an error where the application stops responding. The following code refers to a fragment where you are using the Google Maps API, and means that when I…
java android android-fragment listener alertdialogasked 7 years, 5 months ago Guilherme Vinicius 55 -
0
votes1
answer33
viewsError while editing through SQLITE
I’m trying to edit information that’s saved in the SQLITE gang. I’m working with fragments. But I’m making the following mistake: FATAL EXCEPTION: main Process:…
-
0
votes1
answer412
viewsRetrieve past information in a Bundle
I have a Fragment that calls another Fragment by passing login information to the other. I do this with the following code through the Bundle. Follow the code : ImageView editarBt = (ImageView)…
-
0
votes0
answers118
viewsRadiobutton changes checked when scrolling Listview
Good afternoon, I have a problem with Radiogroup on a listview. Next, when I mark a Radiobuttom and use the scroll of my listview, the marking I made appears in another Radiobutto and not in what I…
-
0
votes2
answers161
viewsNull Object Reference when opening a Dialog Fragment
Making a mistake opening a Dialog Fragment in a another Activity using a method. ERROR: 07-06 11:21:25.145 18783-18783/com.vuforia.samples.Books E/Androidruntime: FATAL EXCEPTION: main Process:…
-
0
votes1
answer52
viewsI’m trying to create a Fragment that has an image slide any idea?
I am trying to use this example Daimajia / Androidimageslider, did not succeed.. someone can help me ' public class Fragmentteste extends Fragment Implements Basesliderview.Onsliderclicklistener,…
-
0
votes1
answer76
viewsFragments does not disappear
Good evening, I am creating an app to train and in it contains side menu that each menu item calls a Fragment only that I’m in trouble, because when I click on an item it appears the called…
-
0
votes1
answer101
viewsAttempt to invoke virtual method 'java.lang.String android.widget.Spinner.toString()' on a null Object Reference
I am trying to save the data of a spinner in a variable through findviewbyid, to later be saved in SQLITE. The data is, name, type, third and date. But when I try to set this data, it is generating…
-
0
votes1
answer268
viewsPass value from Dialogfragment to Fragment
I have fragment1 and Datepickerfragment In the case DatePickerFragment extends DialogFragment I would like when selecting the date to return to Fragment. Only you’re giving it here:…
-
0
votes1
answer37
viewsHow to run a Recicle view on other activitys
How do I place a recicle view or a list view in some other Ctivity ? Example: I created a project with name X dai in it so I put the layout as Empty Activity and such it generates me an…
-
0
votes0
answers113
viewsHow to send data from an Activity to a Fragment?
1I’ve been having a question for a while. I want to pass a value of a activity for a fragment, however, the error when opening the fragment to be specific when receiving this value, I believe. This…
-
0
votes0
answers34
viewsInstantiate Fragments only once with navigationBotton
You guys good night, I really need a force, I am implementing a navigation Bottom to navigate through Fragments, but in one of the Fragments there will be a counter and when I navigate through the…
-
0
votes1
answer496
viewsHow to pass data from one Fragment to another (upadte Sqlite)?
I’m developing an app with Sqlite, I want to take the dice of a ListView (where I am displaying the saved information) and want to play for a Fragment to enable the user to edit it. I’ve tried…
-
0
votes1
answer55
viewsAlertdialog with Fragmentmanager
public void mapaDialog(View view){ AlertDialog.Builder mBuilder = new AlertDialog.Builder(CadastroAbrigo.this); View mView = getLayoutInflater().inflate(R.layout.mapa_flutuante, null);…
-
0
votes1
answer242
viewsRecycler view does not load when the app first opens
I have a recycler view within a fragment in a tablayout, being the main tab. After logging in, it does not load the data, only loads if I change tab and return, or close and open the APP. Code:…
-
0
votes0
answers252
viewsHow to send data from an Activity to a Fragment
I’m trying to send my data from Activity CorridaEsteiraActivity to the Fragment FragmentCorrida and save them in a listview, however I did not succeed in my attempts, below follows the two classes:…
-
0
votes1
answer137
viewsBottomnavigationview is not at the bottom of the screen
I am with a problem is a layout I am developing, this is my Activity for customer registration and I have only in it a Bottomnavigationview, and a Linearlayout that I will replace with a Fragment…
-
0
votes2
answers306
viewsAlertdialog Custom Layout - Nullpointerexception Error
You guys talking beauty? So I tried to create a Custom Aler Dialog, but every time I try to save it, it gives a Nullpointerexception error, but I don’t know what the cause is. The code of the method…
-
0
votes2
answers68
viewsProblem with Bottonnavigationview
As you can see I’m with a little problem of layout in this form on Android, this form is opened inside a Fragment normally where I will send this data. 1- To my surprise the EditText does not expand…
-
0
votes1
answer226
viewsHow to set values in a Fragment instead of an Activity using Drawer menu?
I created a slider menu in my application and I was able to call an Fragment when selecting the menu options but I am having difficulties to print the values in this Fragment instead of using an…
-
0
votes1
answer310
viewsHow to call a Method in View using a Class that extends from Fragment
I have several buttons in a view that call the addNumero method in Onclick, something like this: <Button android:layout_width="match_parent" android:layout_height="match_parent"…
-
0
votes0
answers33
viewsI can only access the first Fragment with tabs
After some time without updating my apps I have to change them to adapt to Admob 7.0.0. In two of them use fragments on tabs (one with two tabs and the other with three) and he always positions on…
-
0
votes1
answer606
viewsHow to open the virtual keyboard on a Fragment focusing on editText?
Hello I am developing an application and when loading the screen to register the focus is on an editText but I need to automatically load the virtual keyboard of Android. public class…
-
0
votes1
answer208
viewsHow to make a View overlap?
I have this XML: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"…
-
0
votes0
answers633
viewsUpdate data in a Textview automatically in Android Studio
I’m building a project where I need my app (made in android studio) to pull data from a local server and update automatically without needing a "refresh" button or a "Swipe to refresh". At the…
-
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
answers41
viewsError opening Android app project
When opening the Android app project of a friend of mine on my PC, I came across these errors. How do I fix it ? screen images : Grandle code ( app module ) : apply plugin: 'com.android.application'…
android android-studio android-layout android-activity android-fragmentasked 6 years, 3 months ago jhonatan santos 103 -
0
votes1
answer94
viewsGo from main activity to fragment
I’m building an app on Android and in it will have among the various activities a Fragment for user profile. The problem is that it would need, from the profile selection, to go from the main…
-
0
votes1
answer116
viewsUpdate Facebook within Pageview with Tab
Galley, See if you can help me, I’ve had this problem for two days and I can’t fix it. My app got Pagaview, Tablayou, and 3 Fragment Ok? As picture below: In my third tab I have the following…
-
0
votes1
answer154
viewsAndroid - How to detect which is the current fragment?
Hello, I have an application that uses the fragments system and a Floatactionbutton, in one of the fragments I have an ad banner right under the Floatactionbutton, I did it the way below, but it…
-
0
votes2
answers115
viewsHow to overwrite the Onitemselected method of a Spinner?
I’m trying to overwrite the method Onitemselected of a Spinner in my Fragment, the same way I did with the Button, but it’s not working... how could I get the same result? Inside Oncreate, the…
-
0
votes1
answer73
viewsHow to handle data entered into a fragment of a Tabbed Activity in Android Studio
I am learning to develop using Android Studio and I am with a beginner’s question: which class I perform data processing from a click of a fragment in a Tabbed Activity. To illustrate simply, I…
-
0
votes0
answers166
viewsTransfer objects between Ragments
Good evening.. I’m a beginner in Java Android and I’m developing an application to be used on Gertec’s credit card machine. However my application will have other forms of payment besides card…
-
0
votes1
answer356
viewsCannot resolve method
I’m making an application for Android in which there is a Fragment to add a task (with title and description), and a Fragment that lists all the tasks stored in a Singleton. In Tasks Fragment when…
-
0
votes1
answer71
viewsHow to create a Fragment by clicking a button?
I have the following Fragment: public class ListaBimestresFragment extends Fragment { public ListaBimestresFragment() { // Required empty public constructor } @Override public View…
-
0
votes1
answer34
viewsUse findViewById in Android Studio’s standard Mapsactivity
I’m using the standard Maps template available on Android Studio, and in the activity_maps.xml added a EditText with the id towhere. In the Mapsactivity class I just added a…
-
0
votes1
answer219
viewsOpen fragment by clicking on Cardview
My home screen has 3 cardviews: main.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"…