Questions tagged as 'android-fragment'

1
answer

Problem 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.example.gustavo.easypasse.RecargaActivity@30d409a0 must implement OnFragmentInteractionListener And point...
asked by 08.11.2017 / 20:08
1
answer

BottomNavigationView is not at the bottom of the screen

I have a problem with a layout that I'm developing, this is my activity for client registration and I only have a BottomNavigationView, and a LinearLayout that I'll replace with a ActivityCadastroCustomer      <LinearLayout and...
asked by 07.12.2017 / 14:44
1
answer

Why 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, would not it be simpler to do as when creating an Activity, such as overwriting the onCreate method and setting u...
asked by 25.01.2018 / 01:04
1
answer

How to use AppCompatActivity functions inside a Fragment? [duplicate]

I have a fragment and need within it some of the functions of AppCompatActivity, how to implement the two in the same class? You're like this: public class clientes extends Fragment { I've tried: public class clientes extends Fragmen...
asked by 31.01.2018 / 21:13
1
answer

How 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 DatePickerDialog.OnDateSetListener hourSetListener; private DateP...
asked by 08.07.2017 / 13:37
2
answers

How 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 = activity.getFragmentManager(); FragmentTransacti...
asked by 01.09.2017 / 20:25
2
answers

RadioGroup in ListView does not maintain selection after scroll

I have a Listview with some information and within them have a RadioGroup, but when I roll all my screen checkbox is unchecked coz the listview is creating these checkbox again. I need to have my checkboxes tick when scrolling the page. Here...
asked by 30.06.2017 / 18:43
1
answer

How to open an AlertDialog?

Well, I'm learning about Fragments now. From what I understand, fragments are components, something you want to repeat on several screens, without having to create multiple class or activity's. I'm trying to create a dialog, it will be using...
asked by 10.06.2017 / 00:58
1
answer

Which 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, respostas integer not null, resultado float);");...
asked by 21.07.2017 / 19:35
2
answers

Change the Bar Status 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 Fragment to which I want another color in the Status Bar. Is there any way I can change the color of the Status Bar only when that Fragment...
asked by 27.07.2015 / 20:49