Questions tagged as 'android-fragment'

1
answer

Fragment is not replacing the marked layout

I'm working on a college project and I'm having a hard time replacing a given layout with a fragment. What is happening is that the snippet is not replacing the layout with activity but rather, merging with it. This is the block of code...
asked by 31.03.2017 / 17:26
2
answers

Warning: (40, 5) Do not place Android context classes in static fields; this is a memory leak

I'm running into this warning from Android Studio. Warning: (40, 5) Do not place Android context classes in static fields; this is a memory leak (and also Instant Run breaks) I have a button that opens a DatePicker fragment to select the date....
asked by 24.10.2017 / 21:12
3
answers

How to insert markers (marker) on a map in another fragment?

I'm developing an Android app where you enter a list of courier tasks (get something in point A and take it to the point B ) and these points are shown on a map App has two snippets: ReclyclerView containing the ta...
asked by 08.01.2017 / 18:31
3
answers

Pass data between fragments

Well I need the following: I have an application that will Acticity this is the main and controls the entire application, I also have some fragments 2 of them are interface other 2 run in the background. The question is to pass...
asked by 08.08.2016 / 04:43
1
answer

How to send a json from an Activity to a Fragment?

I have an activity that adds a die in JsonObjetct. And as seen in the following code, I take it as string, but, my doubt, how do I by this JsonObject in the fragment so I can work with it, as Json? Follow the Activity code: ......... ob...
asked by 16.03.2017 / 18:17
1
answer

The Radio Button does not change the text

I created a simple project, and realized that RadioButton does not change the text when rotating the screen. I created 2 functions one called setText() and the other setText2() with different contents, setText() is ca...
asked by 20.12.2015 / 23:03
3
answers

Use methods of an Activity in a Fragment

I'm trying to use some methods of an Activity in a Fragment, but I can not, can someone tell me if it's possible? public class updateMarker extends Activity { TextView uid; //URL to get JSON Array private static String url = "http...
asked by 17.12.2015 / 12:47
1
answer

Android - Transfer data and change Fragment per Click

Hi, guys. I need help transferring from Fragment when I click on my button inside a ListView. Currently I have a MainActivity (extends AppCompatActivity) to manage the Fragments. Below are some screenshots of how the App is Fragment 1:...
asked by 02.06.2016 / 17:42
1
answer

How to create a class with a NavigationDrawer to use in various Activities?

I started studying Android development a short time ago, I saw that to use a NavigationDrawer it is recommended to use fragments to change a FrameLayout in the main Activity, but in the new activities that I create, I did not want to have to put...
asked by 15.12.2015 / 14:12
2
answers

Call a new activity through a fragment

I have the following code: Fragment: public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment View i = inflater.inflate(R....
asked by 18.03.2016 / 20:02