Questions tagged [fragment]

1

votes
0

answer
135

Views

Persistent Multiple Choice List - ArrayList reset

The Android documentation provides the following code for a multiple choice DialogFragment and describes it as a 'persistent multiple-choice list' @Override public Dialog onCreateDialog(Bundle savedInstanceState) { mSelectedItems = new ArrayList(); // Where we track the selected items AlertDialog.B...
Florian Walther
1

votes
0

answer
101

Views

How to add Fragment from BaseAdapter

I'm developing an English-Japanese learning app, where it has a stack of cards where users can swipe through, and on each current card, the user can touch the card to flip to the other side of a card, which show the meaning of the word. For the swipe function, I'm using a library SwipeFlingAdapterVi...
Quan Nguyen
1

votes
0

answer
33

Views

Uploading failed due to this error

Where possible, set exported=false for the PreferenceActivity in your Manifest. This will prevent foreign apps from sending Intents to this class. If the vulnerable PreferenceActivity must be exported to foreign apps then determine why the class is vulnerable and take the appropriate actions. There...
1

votes
1

answer
118

Views

Fix blink in Fragments during addSharedElement() transition

I use the next code in Fragment A: fragmentManager!! .beginTransaction() .addSharedElement(viewHolder.characterImage, ViewCompat.getTransitionName(viewHolder.characterImage)) .addToBackStack(TAG) .replace(R.id.fragmentContent, CharacterFragment.newInstance(url, viewHolder.characterName.text.toString...
Ruslan Leshchenko
1

votes
0

answer
311

Views

How to handle overlapping in fragment on back pressed?

I am facing two issue in on back pressing in fragment . First issue is , in my activity i have main fragment in that when i click the button it is replaces the another fragment B. In B fragment i have three button, clicking on each button is replaced by three fragments.Fragment C, Fragment D, Fr...
Prabhakaran
1

votes
0

answer
59

Views

Shader two outputs feedback

I want to get two outputs from my shader, then feed them back into the shader to use as an iterator och accumulator. This works fine for the default 'channel', but for two... So, here are the shaders: #version 420 uniform sampler2DRect inData0; uniform sampler2DRect inData1; out float outData0; out...
user3162781
1

votes
1

answer
26

Views

How to manage JAR dependencies from the consuming application

I have created two JAR files. The first contains the core logic to a scheduling service. The second is a Web Fragment Project that contains an optional JSF presentation layer for the former. Each contains its own dependencies in their respective LIB folders and references them in their build path. W...
vhdz04
1

votes
2

answer
72

Views

Application Fragment

This code shows an error : private void selectItem(int position) { Fragment fragment; switch (position) { case 1: fragment = new PizzaFragment(); break; case 2: fragment = new PastaFragment(); break; case 3: fragment = new StoresFragment(); break; default: fragment = new TopFragment(); } android.app...
Bharat Khadodra
1

votes
2

answer
97

Views

I have error in this class how to fix?

I'm using fragment in my project and I want to use sqlite database in part of project but I have error in part of The following class package com.androiddeft.navigationdrawer; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup...
1

votes
1

answer
72

Views

Reload Fragment On BackPressed from Child Fragment

I have two Fragments-Parent Fragment and Child Fragment. My Parent Fragment consists of RecyclerView and CardView with some user data and the Child Fragment consists of Detailed Page of Cardview content which consists of some likes and comment buttons.As soon as I hit the like button in child Fragme...
Payal Gupta
1

votes
1

answer
98

Views

Prevent ColorMask obscuring parts of an object's mesh

I am trying to use a shader to prevent an object being rendered when it leaves a specific area. However, when using a surface shader to do this, to fix drawing issues I have to use a depth buffer. Currently I am doing this by Pass { ColorMask 0 } However, this is causing an effect that doesn't rende...
Dan
1

votes
1

answer
44

Views

Data in ListFragment is not being displayed

I am trying do display a list of employees in ListFragment, few days back it was working exactly as I needed but then it suddenly stopped displaying data. I tried printing data in Log and it is successfully showing the list of employees. Any help is highly appreciated ListFragment public class List...
Vismay Patil
1

votes
0

answer
43

Views

Which lifecycle callbacks are called when quick settings menu is opened?

Hi i have an (Main) activity which hosts (Match) fragment. I want to get notified when quick settings menu is opened. On MatchFragment i tried to overwrite methods as onStop(),onResume(),onPause() and in MainActivity i did the same. I put logs in every callback to see which of them is being called w...
MarkyMark
1

votes
2

answer
191

Views

Disabling the back button on an activity when a dialogfragment is shown

I have an activity that shows a dialogfragment. I've already set the dialogfragment cancelable to false, but the underlying activity still captures the back button press. My underlying activity has overridden the onBackPressed method, but I don't want this to run when the dialogfragment is shown. Ho...
Poly Bug
1

votes
2

answer
392

Views

ViewPager show black screen on swipe which contains camera

What happens is that when Activity runs it shows the camera fragment but when I swipe the view pager for other fragment, it shows the screen fully black. I am not able to access the content of other fragments. This is the layout of my view Pager. Here is the class of that activity public class WallO...
Pratham Khurana
1

votes
0

answer
368

Views

Combine smoothness and metallic with frag Shader

I'm trying to add some Smoothness and Metallic to my custom shader in order to have dark texture for day/night cycle. For the moment, i have a procedurale planet and my shader draw different textures based on height (distance between center of planet and vertex at surface). Until there, it works ! N...
Namnam
1

votes
0

answer
94

Views

creating new page when the user click on add page button in android studio application

I'm trying to code a story application (android studio using java), where a child can use an electronic book to write his stories. now, I want to write story pages code (which is in an image view) open book imagebut I don't know how to do it? Im planning to use fragments, but how can I do that: when...
MMM
1

votes
1

answer
31

Views

How to update Textview of an DialogFragment from another Fragment

First Fragment RequestDialog when I called function request_services_change by same class is working fine but when call by FragmentB is a null pointer and request_services is empty on debugger public void RequestDialog(Context context) { this.listener = listener; } public RequestDialog() { } public...
Mahmoud Gad
1

votes
1

answer
274

Views

How to get a string and convert to a fragment name to start a Class?

Sorry for bad english, I'm Brazilian and I'm using a translator. I have an application with tabs, and I want to simply and dynamically add tabs with titles, or icons, or title and icons together. So I started to build the following class: public static class TabItens { TabLayout tabLayout; SectionsP...
Samanta Silva
1

votes
2

answer
197

Views

Fragment still visible after popBackStackImmediate and replace

I have fragmentA on my backstack and fragmentB on the screen. I want to replace fragmentB with fragmentC so that when user pressed back, we go back to fragmentA. This is how I am replacing fragmentB with fragmentC final FragmentTransaction transaction = getSupportFragmentManager().beginTransaction()...
Marc Li
1

votes
1

answer
76

Views

Saving CheckBox state with SQLite Database

I'm building a list app that uses a SQLite database to hold list items. A list item consists of a UUID, name and boolean value to determine whether or not its is solved (database stores it as an int). What I've noticed is that when a user checks a task off and a new task is added the list is reloade...
aDabOfRanch
1

votes
2

answer
172

Views

onActivityResult not being called from fragment on device, but works fine on emulator

Went to run the app on my device and it isn't functioning as it was on the emulator. The pages are stored as fragments and switched out with a bottom navigation bar. public class HomeController extends FragmentActivity implements Serializable { private BottomNavigationViewEx navBar; private Fragment...
Aaron Nebbs
1

votes
2

answer
58

Views

FirebaseRecyclerAdaptor won't populate recyclerview

Hello I am relatively new to firebase and I've seen that there is new implementation of firebase recyclerview adaptor for fragment. My problem is that the app won't populate my recyclerview. Here is what I have as a code my Fragment public class DummyFragment extends android.support.v4.app.Fragment...
redberry
1

votes
0

answer
40

Views

click button from fragment to handle in other fragment

I have fragment DashboardFragment is tabhost contain fragment AllDeviceFragment back is button on DashboardFragment. (AllDeviceFragmen is tab) AllDeviceFragment contain recycleview is list when I click to one Item it show another list then click on back button how to show old list. thank Dashboa...
user7372142
1

votes
1

answer
108

Views

List View inside ViewPager using nested fragments - huge performance drop

as in topic i have huge problem with optymalization of my activity. wireframe At root level we have three controls: - Tab Layout, related with ViewPager - SurfaceView displaying plot for every fragment - and ViewPager itself ViewPager displays fragments marked on the picture with red color. Every...
Maciek
1

votes
0

answer
111

Views

Metal shaders: converting non-position fragment shader arguments to windows/pixel coords?

In my Metal app I need to do some distance comparisons between the fragment position and a baseline, which I pass in from the vertex shader. The fragment position comes to the fragment shader in window, or pixel, coordinates. I guess this is because the argument is marked [[stage-in]], or maybe be...
bsabiston
1

votes
4

answer
81

Views

When I rotate the Screen, I want to change the layout of MainActivity , which contains two fragment

Here is the info about the exception: E/AndroidRuntime: FATAL EXCEPTION: main Process: app.v.layout, PID: 13198 android.view.InflateException: Binary XML file line #0: Binary XML file line #0: Error inflating class fragment Caused by: android.view.InflateException: Binary XML file line #0: Error inf...
Shun Vedeus
1

votes
2

answer
66

Views

Fragment can't show image

I am very new to using Fragments in Android, and trying to build a simple image slider for my apps, using View Pager. I already have the code and it's not working, the image is not being shown when apps run, anyone can help me solve this. This is my code fragment_home.xml FragmentHome.java public cl...
Kharisma
1

votes
0

answer
22

Views

Why a fragment from the backstack gets triggered when adding a new fragment

Something strange is happening..! So I have an activity with TextView in the center of the toolbar acting as toolbar title, once the activity gets launched, I commit the MainFragment or let's name it Fragment (A). Inside Fragment (A), I replace it with Fragment (B) when a button gets clicked. Insid...
Alaa AbuZarifa
1

votes
1

answer
703

Views

Already managing a GoogleApiClient with id 0 inside a Java Class

I have created a GoogleMap inside a java class so I can reuse it multiple times without repeating code. I currently have two maps on the same fragment. One map, is for the user to select a collection location (Item picked up from). The second map is for a delivery location (Item is going to). Both...
javacoder123
1

votes
0

answer
170

Views

Send NFC records from Activity to Fragments

I am working on a project that has a tabbed activity, there one tab write to NFC tag while the second tab read from NFC tag. My writing tab works perfectly but my reading tab is not. What I want to do is to send NFC records (data) from my tabbed activity (containing the logic of reading NFC tag) to...
DaGuy
1

votes
0

answer
90

Views

Swipe to Refresh in webView in Fragment

I have a webview inside a fragment and I want to add a swipe to refresh the page. I've been trying a lot but nothing works. my .xml and .java ProgressBar progressBar; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout f...
Fabián Muñoz
1

votes
0

answer
43

Views

Metal fragment shader bound resource acting erratically on macOS

This problem has been stumping me, and I can't figure it out. I've got a few different shaders which use the same resource, a structure with a bunch of lighting values. The first shader to use it works fine -- the second one does not. Seems like it might be getting zeroes. The third shader to us...
bsabiston
1

votes
0

answer
151

Views

FragmentTransaction show() hide () issue

I have a bottom navigation bar with 4 menu items, I use FragmentTransaction show() , hide() methods to switch between fragments on tabs click , hide current fragment and show next fragment, Before using show or hide method I must add fragment first and then use show or hide , until now everything wo...
Dev M Hussein
1

votes
0

answer
73

Views

BindingAdapter for fragment

In my main activity layout xml, I have a fragment tag. I would like to create a custom attribute , say app:myCustomAttribute (see below), in the tag using @BindingAdapter. Is this even possible? I can't find a solution online. If not possible, is there any simple way to create a custom attribute...
Bruce
1

votes
1

answer
55

Views

How can i pass a variable from my adapter to a fragment i instantiate in Kotlin

I followed a tutorial on getting started with tabhost and fragments, there is the link: https://medium.com/@eijaz/getting-started-with-tablayout-in-android-kotlin-bb7e21783761 But I got a problem, I want to send a value activityID to a fragment that my tabhost contains and I don't know how to do it....
Nicolas Felten
1

votes
0

answer
154

Views

Bottom Navigation bar doesn't switch Fragments

I (beginner) just coded a bottom navigation bar with help of this forum on Android Studio (API19) and it compiles start in the emulator, but I just can't figure out why it doesn't switch Fragments when you click the Items in the bar. For every Case in the method in Java I created a fragment without...
Kev
1

votes
1

answer
86

Views

commit a fragment transaction with full screen fragment

I have a fragment (Fragment A) and it is not a full screen and I want to open from it another fragment (Fragment B) that fills the whole screen, without knowing the container id Click on the following link to see an image that clarifies the situation Fragment A open Fragment B
Hazem Madkour
1

votes
1

answer
68

Views

Progress dialog never shows up

I am trying to show a progress dialog on click of a list item, but the progress dialog never shows up. Surprisingly, mProgressdialog.isShowing() is true. Please provide some insight into the problem if any one has faced similar issues. adapter.setOnItemClickListener(new Adapter.ListClickListener() {...
1

votes
1

answer
42

Views

Can we change the backgroud color of Linearlayout of Fragmet A from another Fragment B ? without getting error

I want change the background color of of LinearLayout of Fragment A from Fragment B .These fragments are in same viewpager in sliding tabs. The data of both fragment are dynamically changed from server.Here I have to click a textview of Fragment B then its linearlayout's color be changed manually(P...

View additional questions