Questions tagged as 'android-fragment'

1
answer

How to use Recycleview in the snippet?

I do not know if I asked the question correctly, but come on, who can help me thank you:) This is my second MainActivity, I am doing an application with navigation drawer and in it to do the other screens of the menu I am using the fragments,...
asked by 19.10.2016 / 15:44
1
answer

NavDrawer using activities instead of fragments

I'm trying to deploy a NavDrawer in my app but # Part of the code that uses Fragments: private void displayView(int position) { // update the main content by replacing fragments Fragment fragment = null; switch (position)...
asked by 24.01.2015 / 02:48
2
answers

Call a function when a fragment is closed

I have a activity that calls a fragment which is displayed as a DialogAlert . However, when this fragment is closed, I need a method of Activity to be called. What is the best way to do this? The Activity cod...
asked by 24.06.2014 / 02:10
1
answer

fetch all records from an sqlite column

I need to save the names of the users table in a list and save them in an ArrayList. I did this: public List<String> buscarUsuarios() { List<String> nomes = new ArrayList<String>(); String selectQuery = "select nome...
asked by 05.07.2017 / 20:40
1
answer

Android - How to detect which fragment is current?

Hello, I have an application that uses the fragments system and a FloatActionButton, in one of the fragments I have an ad banner just below the FloatActionButton, I did the form below but it does not work with the fragments on the stack, is there...
asked by 26.09.2018 / 12:56
1
answer

How to open the virtual keyboard in a fragment with focus on editText?

Hello, I'm developing an application and loading the screen to register the focus is in an editText but I need to automatically load the Android virtual keyboard. public class AddHerosFragment extends Fragment implements TextView.OnEditorA...
asked by 30.01.2018 / 01:54
1
answer

Call a class method 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" android:background="@drawable/gradiente_azul_semconor"...
asked by 20.06.2017 / 19:09
1
answer

java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.View.findViewById (int)' on a null object reference

I have a fragment that through one button it will call the other fragment. But the following error is appearing. 06-20 19:12:12.075 17971-17971/com.example.gerdaumanagement.gerdaumanagement E/AndroidRuntime: FATAL EXCEPTION: main...
asked by 20.06.2017 / 21:19
1
answer

How to use FindviewById and Onclick on a fragment?

I added two tabs in the main activity layout, and created two java class, one for each tab. So I took the activity xml buttons from main activity and put it in the fragment layout, but I will use the find view by id in the java class of the frag...
asked by 09.07.2017 / 20:48
4
answers

How do I insert a button after a listview?

Hello, I need to insert a button right after my listview. That is, when I finish sliding my listview will have a button at the end. I'm trying to do as follows: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"...
asked by 08.06.2017 / 20:20