android-fragments

Send data to fragment with FragmentTransaction

天大地大妈咪最大 提交于 2020-05-11 05:56:31
问题 I'm in my fragment class calling this: @OnClick(R.id.blockedLinkLayout) public void onBlockedClick(){ final FragmentTransaction ft = getFragmentManager().beginTransaction(); ft.replace(R.id.content, new SettingsBlockedUsersFragment(), FRAGMENT_TAG); ft.commit(); } And it just replace my current fragment with chosen one. And my question is, how can I send some data (e.g. String value) from my parent fragment to my child fragment using FragmentTransaction? 回答1: Just pass them in a bundle as

Send data to fragment with FragmentTransaction

 ̄綄美尐妖づ 提交于 2020-05-11 05:51:20
问题 I'm in my fragment class calling this: @OnClick(R.id.blockedLinkLayout) public void onBlockedClick(){ final FragmentTransaction ft = getFragmentManager().beginTransaction(); ft.replace(R.id.content, new SettingsBlockedUsersFragment(), FRAGMENT_TAG); ft.commit(); } And it just replace my current fragment with chosen one. And my question is, how can I send some data (e.g. String value) from my parent fragment to my child fragment using FragmentTransaction? 回答1: Just pass them in a bundle as

java.lang.NoSuchMethodException for onCreate

大城市里の小女人 提交于 2020-05-10 03:08:10
问题 I see crashes in the Google Play crash log that is really stumping me. java.lang.RuntimeException: at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3086) at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3229) at android.app.servertransaction.LaunchActivityItem.execute (LaunchActivityItem.java:78) at android.app.servertransaction.TransactionExecutor.executeCallbacks (TransactionExecutor.java:108) at android.app.servertransaction

java.lang.NoSuchMethodException for onCreate

安稳与你 提交于 2020-05-10 03:07:50
问题 I see crashes in the Google Play crash log that is really stumping me. java.lang.RuntimeException: at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3086) at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3229) at android.app.servertransaction.LaunchActivityItem.execute (LaunchActivityItem.java:78) at android.app.servertransaction.TransactionExecutor.executeCallbacks (TransactionExecutor.java:108) at android.app.servertransaction

Restoring fragment state when changing fragments through bottom navigation bar

家住魔仙堡 提交于 2020-05-09 18:32:41
问题 I have bottom navigation bar on click of item in navigation bar i am replacing fragments. I have 3 fragments A,B,C so on click of b item B fragment is loaded and in B i am calling 3-4 APIs. So now if i go to C and then again come to B a new instance of B Fragment is created and again those APIs are called how can i save the fragment instance state and not call APIs again while changing fragments. This is my code. mBottomNavigationView.setOnNavigationItemSelectedListener(new

Navigation Architecture Component - BottomNavigationView with Login Screen

孤人 提交于 2020-05-05 19:49:52
问题 I have my MainActivity setup which looks like this : <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".ui.host.HostActivity"> <fragment android:id="@+id/mainNavigationFragment" android:name="androidx.navigation.fragment.NavHostFragment" android

Navigation Architecture Component - BottomNavigationView with Login Screen

萝らか妹 提交于 2020-05-05 19:49:50
问题 I have my MainActivity setup which looks like this : <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".ui.host.HostActivity"> <fragment android:id="@+id/mainNavigationFragment" android:name="androidx.navigation.fragment.NavHostFragment" android

Navigation Architecture Component - BottomNavigationView with Login Screen

别等时光非礼了梦想. 提交于 2020-05-05 19:48:49
问题 I have my MainActivity setup which looks like this : <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".ui.host.HostActivity"> <fragment android:id="@+id/mainNavigationFragment" android:name="androidx.navigation.fragment.NavHostFragment" android

Navigation Architecture Component - BottomNavigationView with Login Screen

大兔子大兔子 提交于 2020-05-05 19:48:12
问题 I have my MainActivity setup which looks like this : <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".ui.host.HostActivity"> <fragment android:id="@+id/mainNavigationFragment" android:name="androidx.navigation.fragment.NavHostFragment" android

My recycler view is not showing any firebase images

给你一囗甜甜゛ 提交于 2020-05-04 10:55:33
问题 I am trying to retrieve data from the database to a recyclerview but the only name of an image is showing in the recyclerview. The image is not getting load in image . Here is my code and firebase images. fragmentHealthtips.java package com.example.bbeast.HomeActivity; import android.net.Uri; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; import com.bumptech