返回首页
We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [android-fragments]

Fragments represent reusable behaviors or portions of user interface in an Android app.

Filter by
Sorted by
Tagged with
0
votes
0answers
17 views

Android Studio Navigation Drawer - doesnt work

I try to build simple app using Navigation Drawer template. I build first tab, now I want to build second, but Android Studio dont show my changes. I even try copy 1:1 fragments but this still doesnt ...
-1
votes
1answer
30 views

why fragment not showing empty white screen?

I am developing a news app and I have implemented ViewModel in fragment class and getting data in fragment class but it is loading progress bar only not showing data which coming from server below My ...
0
votes
0answers
6 views

Translucent status bar overlaid on top of dialog fragment in adroid

I'm working on this dialog fragment as shown below. The finishing touch is to make the status bar at top transparent and overlaid on top of the dialog fragment beneath it. I tried several approaches ...
0
votes
0answers
23 views

How to conditionally click items in recyclerView(), and call onClick() set on item?

I have asked similar question yesterday here, but now I studied recyclerView(), Adapter, ViewHolder and else. I am working on Stripe-terminal-android-app, my main screen is fragment_terminal.xml, ...
1
vote
1answer
17 views

Back Stack count increasing when clicked on fragment in background

I am adding the next fragment when clicked on textView in each fragment. My Flow is MainActivity => Fragment A => Fragment B => Fragment C => Fragment D But every time I click on textView in ...
0
votes
0answers
12 views

fragmentScenario Espresso tests of Fragments in Dynamic feature modules

Has anyone figured out how to test fragments in Dynamic feature modules in isolation using fragmentScenario Espresso tests where the app's Activity is in a base module. I have overcome several issues ...
1
vote
1answer
36 views

Change TextView values with method inside Fragment (NullPointerException)

I'm trying to make an app (for learning purposes) where I have a few tabs with scrollable content. I have a collapsing app bar with a ViewPager for the main layout and three identical layouts with a ...
0
votes
0answers
30 views

How to click button inside method Adapter in RecyclerView?

I am working on stripe-terminal-android-app, to connect to BBPOS 2X Reader device, wanted to click-item from list,(recyclerView). I am trying to do: when list of devices appears(readers), I am ...
0
votes
0answers
14 views

Hitting enter on keyboard inflates AlertDialog in fragment from backstack

I just discovered this issue recently where if I hit enter on the keyboard of my my current fragment, it creates an AlertDialog that is from the latest fragment in the backstack. How do I prevent this ...
0
votes
2answers
39 views

ClassCastException when casting View.getContext() to androidx.appcompat.app.AppCompatActivity

When I attempt to start a Fragment from an Adapter, I get this exception. I looked for similar issues, but casting to androidX is relatively new, so I couldn't find relevant solutions. I found a ...
0
votes
0answers
29 views

FragmentManager has been destroyed

EDIT: It seems that this only happens if my previous activity is in landscape, and the setRequestedOrientation() is portrait, what could possibly be the problem? I have a code in an activity, which ...
0
votes
0answers
21 views

how to access app module classes from library classes in android multiple apk in single project?

I don't access the app module fragment class data in the library module in my project. There are two app module first is (dealer) and second is (wholeseller) and one library module (common). In my ...
0
votes
0answers
19 views

Cannot update RecyclerView inside a Fragment

I have an activity that uses a ViewPager to contain 2 Fragments. Inside one of the fragments I have a recyclerView. Until now When I first run the app the view is show correctly. The fragment makes a ...
0
votes
0answers
20 views

why my calendarView is not showing when clicking next button in fragment?

why my calendarView is not showing when clicking next button in fragment? This is my code regarding to http://www.youtube.com/watch?v=JBsoLYhv3nQ&t=412s barber booking app public class ...
0
votes
0answers
22 views

Fragment view state not saved on back press when using Android Jetpack Navigation

In my app I'm using the Jetpack navigation component and I have an issue with fragment state not being saved when navigating back to a fragment. When I navigate from MainFragment to SettingsFragment ...
0
votes
0answers
15 views

Pass value from Fragment WebView to MainActivity

Having received a certain value in the Fragment via @Javascriptinterface, I want to pass this value to MainActivity in order to perform some action with this variable. The fragment should be closed. ...
0
votes
0answers
37 views

Kotlin ViewPager Null PointerException

I'm trying to get a viewpager in an already existing fragment. In another project I had no issues when the viewpager was in activity_main.xml One of the things I tried is the following: ...
0
votes
1answer
34 views

Recycler view not showing items in fragment

Fetching data for Recycler view here.but showing no items in recycler view. data is available in database and fetching it in OnCreate() method. but when comes to onCreate() method, there is no data. ...
0
votes
1answer
33 views

How to stop multiple intents from opening sequentially?

I have a list of invoices displayed in one Java activity, and I included the ability to click on one of the invoices to open a new activity that shows its details (using an intent). The issue is, the ...
0
votes
2answers
44 views

Adapter is throwing a java.lang.NullPointerException

I'm getting the following error: java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.Object java.util.List.get(int)' on a null object reference at com.example....
0
votes
1answer
31 views

Can't depend on Firebase ML Kit

I'm trying to add firebase's ML Kit as a dependency in my android application: dependencies { implementation("com.microblink:blinkinput:${rootProject.ext.blinkInputVersion}@aar") { ...
0
votes
0answers
16 views

Unity player in activity keeps showing even after adding a fragment on top

I am using Unity in my Android app. I exported the android project from Unity and then imported it in Android Studio. I have the following activity xml. <FrameLayout android:id="@+id/...
1
vote
1answer
29 views

Unable to NotifyDataSetChanged on a RecyclerView when EditText is in Focus

I have an Activity with a fragment called MainFragment which has a ViewPager2 to display a few Fragments. One of which is SearchFragment. SearchFragment has an EditText with a TextWatcher, upon text ...
0
votes
1answer
20 views

getSupportFragmentManager().findFragmentByTag() not finding the right fragment

I upgraded my app from SDK 26 to SDK 28 and it ruined my app's navigation. I have a central tabbed activity. In each tab, the flow of the app is managed by fragments. I have implemented the back press ...
1
vote
1answer
21 views

Get UI Element ID In a Fragment From Custom adapter

I'm developing an android app and I have a fragment that contains TextView & ListView in it. The list view has custom list items that contains two buttons. I want to make 'onClickListener' for one ...
1
vote
1answer
28 views

OKHttp crashes on when switching Fragments

I have no formal coding education so please let me know if something I did is considered bad coding I am using a bottom navigation view for a train schedule application I am making. One of the ...
2
votes
1answer
38 views

Passing data from activity to fragment in android is not working

I want to pass parameters from activity to fragment. This is the code from the activity: public class MatchActivity extends AppCompatActivity { @Override protected void onCreate(Bundle ...
1
vote
0answers
17 views

BottomNavigationBar goes down partially when I change fragments

I use BottomNavigationBar(bnb) with Navigation(android jetpack). It's a single-activity app. There are 3 fragments. One of them is starting. When I perform the navigation from starting fragment to any ...
0
votes
0answers
24 views

How can I show app users current location with different icons?

I am developing an android app for blood donation and I am almost finished. I already created a database mysql with full user details and current locations. Now I want to show all the users in map ...
-3
votes
1answer
42 views

How to design a Layout in Android Studio as shown in the picture?

I've to design the given layout for my application and since I'm a beginner to Android development, I do not know which component to use. Please guide me.
1
vote
1answer
30 views

Kotlin: FragmentPagerAdapter not changing layout of ViewPager

I am trying to create a tabular layout for my Android application through an adapter class. However, the layout represented in the ViewPager does not change when I click on different tabs. Below is my ...
0
votes
3answers
30 views

Android Studio Kotlin - Change EditText text from a fragment

I need to edit a editText which is on main_layout from a fragment instead of MainActivity(). I've tried inflating main_layout to fragment but that doesn't worked (editText doesn't change), then I've ...
-4
votes
0answers
37 views

i unable to run setfab.setOnClickListener(new View.OnClickListener(), if i click in onlick intent app automatically sttoped [duplicate]

2019-11-10 00:11:11.004 20790-20790/com.adworld.admin.forplay E/AndroidRuntime: FATAL EXCEPTION: main Process: com.adworld.admin.forplay, PID: 20790 java.lang.RuntimeException: Unable to start ...
0
votes
1answer
14 views

How to differentiate action for SearchView submit based on Fragment?

I have multiple fragments in my app. I want to add search function to may app. When i add search view in toolbar, the listener is in MainActivity. The problem is when i submit the query, the action ...
0
votes
2answers
32 views

How to open/close layout on click & also on scroll?

click here to check gif file Hello I'm a beginner. I want to create anim like calendar layout in gif file. Queries : Whenever I click on button (November show in gif file. I have button in toolbar ...
0
votes
3answers
31 views

Shared prefence from activity to fragment

My app have mainactivity User must set a password and it saved in shared prefence like this settings = getSharedPreferences("NAME", 0); SharedPreferences.Editor editor = settings.edit(); editor....
1
vote
4answers
47 views

Return back to Fragment from Activity

I have MainActivity with BottomNav which includes 3 Fragments A, B, and C. From Fragment A, I can go to Activity A and from, Activity A I can go to Activity B. Now I want to return to specifically ...
0
votes
1answer
25 views

How to add action layout over fragment bottom in viewpager each item

I am trying to create a tablayout using viewpager, and I want to add a clear button on fragment bottom part to clear fragment view from viewpager as shown in the figure. Image link or figure link
0
votes
1answer
20 views

SavedStateProvider with the given key is already registered

I'm currently trying the new Jetpack ViewModel with savedState. implementation 'androidx.lifecycle:lifecycle-viewmodel-savedstate:1.0.0-rc01' I'm using 1 Activity and trying to share 1 ViewModel ...
0
votes
1answer
21 views

Fragment not attached to the FragmentManager when loading Admob

Getting the following error when trying to load my NativeAd - java.lang.IllegalStateException: onGetLayoutInflater() cannot be executed until the Fragment is attached to the FragmentManager. at ...
0
votes
0answers
18 views

Displaying Fragments in android dynamically

I am trying to create simple a fragment and it is displaying nothing. What is wrong? This fragment has to be displayed dynamically. This fragment will display one image from folder drawable. Class ...
0
votes
2answers
36 views

Is there a way to finish the current activity with a button of an alert dialog?

I'm having issues with the alert box that I've created. My intention was to restart or finish the activity of my Change Activity page by using the alert box. However, having finish(); does not work ...
-1
votes
1answer
48 views

How to call activity directly without clicking button?

I am working on stripe-terminal-android app, they have built-in app, but I wanted to customise it according to use-case. link of stripe-app-repo when I open app it first gives me fragment, to ...
0
votes
1answer
33 views

Where to place sign in credentials check - android Dialog

I am trying to create a login credential screen when user clicks on a setting button. And if login credentials looks right then it should to settings screen. This is the official tutorial i am ...
0
votes
0answers
41 views

“How to fix: View in Fragment does only get updated the first time the Fragment is displayed”

I have a containerView within a Fragment that has to be resized according to the screensize. For this reason I view.post{} in onViewCreated. When navigating to the fragment for the first time, ...
0
votes
1answer
58 views

How to save new imagebutton picture and load newly created imagebutton image on relaunch

I am trying to reload the image that I get from either my gallery or camera in the imagebutton once the app closes I have tried saving it to a file and loading from that file but I cannot get it to ...
0
votes
1answer
41 views

How to use MVVMCross to compose fragments into an Activity when dealing with class libraries

If you have the following project structure: Main Project - Android Host app Component A - Android Class Library Component B - Android Class Library If Main Project contains the MainActivity that ...
0
votes
2answers
31 views

Retrieve Fragment from Navigation Drawer

I'm currently trying to instantiate fragments from navigation drawer. The problem is that in the past I was able to do that by: MyFragment fragment = getSupportFragmentManager().findFragmentByid(R.id....
0
votes
0answers
50 views

How to solve 'Firebase Database component is not present' Error?

I get this error when I click on the second fragment from the navigation drawer in the app. The second fragment is where I try to connect to the Firebase database. I don't understand why because I ...
1
vote
1answer
34 views

Which one of these is the best way to access android fragment views?

How are these methods different from each other when trying to get the view? First: @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle ...

返回首页
杏彩计划 杏彩官网 杏彩APP 杏彩走势图 杏彩下载 杏彩官方 杏彩网站 杏彩怎么玩 杏彩官方 杏彩靠谱吗 杏彩代理 杏彩骗局 杏彩投注 杏彩倍率 杏彩开奖 杏彩漏洞