Fixed
Status Update
Comments
al...@gmail.com <al...@gmail.com> #2
Yes, this is correct. Having individual navigation graphs on each activities overrides or disallow up navigation to the main activity.
lp...@google.com <lp...@google.com> #3
I believe I have found the potential problem that is causing this:
// @ androidx.navigation.NavController
// line 124
// Now record the pop operation that we were sent
if (!mBackStack.isEmpty()) {
mBackStack.removeLast();
}
// We never want to leave NavGraphs on the top of the stack
while (!mBackStack.isEmpty()
&& mBackStack.peekLast() instanceof NavGraph) {
popBackStack();
}
the condition in while loop is never satisfied because of the above `if` statement above it has already removed the last item of the mBackStack (which was the NavGraph) and thus popBackStack() is never called again.
// @ androidx.navigation.NavController
// line 124
// Now record the pop operation that we were sent
if (!mBackStack.isEmpty()) {
mBackStack.removeLast();
}
// We never want to leave NavGraphs on the top of the stack
while (!mBackStack.isEmpty()
&& mBackStack.peekLast() instanceof NavGraph) {
popBackStack();
}
the condition in while loop is never satisfied because of the above `if` statement above it has already removed the last item of the mBackStack (which was the NavGraph) and thus popBackStack() is never called again.
al...@gmail.com <al...@gmail.com> #4
According to Ian Lake, NavigationUI does not support up navigation yet, that is why this is a feature request.
+Pedro Varela - we don't support navigating up through activities as part of NavigationUI yet, please star the feature request:https://issuetracker.google.com/issues/79993862 (this issue)
+Pedro Varela - we don't support navigating up through activities as part of NavigationUI yet, please star the feature request:
lp...@google.com <lp...@google.com>
lp...@google.com <lp...@google.com> #5
Ian Lake said Up navigation is not supported through activities, only through fragments.
hp...@gmail.com <hp...@gmail.com> #6
With the introduction of AppBarConfiguration, this is now possible with the setupActionBarWithNavController method by using an empty set of top level destinations (to always show the up button) and then overriding onSupportNavigateUp() as per the documentation: https://developer.android.com/topic/libraries/architecture/navigation/navigation-ui#action_bar
I'll leave this bug open as we still need an equivalent API for the Toolbar versions.
I'll leave this bug open as we still need an equivalent API for the Toolbar versions.
hp...@gmail.com <hp...@gmail.com> #7
This allows you to call onSupportNavigateUp() (or super.onSupportNavigateUp() if you're using an ActionBar) from that method to have your Up button transition between activities.
This will be available in 1.0.0-alpha09.
lp...@google.com <lp...@google.com> #8
There is Jarks when implementing this way to navigate up between activities.
lp...@google.com <lp...@google.com> #9
This has been fixed and will be available in an upcoming release.
lb...@gmail.com <lb...@gmail.com> #10
@9 Which one?
lp...@google.com <lp...@google.com> #11
Both the Fragment issues and a workaround in Preference library to prevent this from happening in the future will be released.
lb...@gmail.com <lb...@gmail.com> #12
@11 I mean in which version exactly should we expect it to happen? What would be in the gradle file?
lp...@google.com <lp...@google.com> #13
alpha03, which is yet to be released.
lb...@gmail.com <lb...@gmail.com> #14
@13 You mean :
implementation 'androidx.fragment:fragment:1.1.0-alpha03' ?
implementation 'androidx.fragment:fragment:1.1.0-alpha03' ?
lp...@google.com <lp...@google.com> #15
Oh I see - sorry.
The two fragment fixes will be available in androidx.fragment:fragment:1.1.0-alpha04
However, androidx.preference:preference:1.1.0-alpha03 will depend on fragment alpha04, so you only need to specify androidx.preference:preference:1.1.0-alpha03 to bring in these fixes and other changes in Preference.
The two fragment fixes will be available in androidx.fragment:fragment:1.1.0-alpha04
However, androidx.preference:preference:1.1.0-alpha03 will depend on fragment alpha04, so you only need to specify androidx.preference:preference:1.1.0-alpha03 to bring in these fixes and other changes in Preference.
lb...@gmail.com <lb...@gmail.com> #16
@15 Thank you
hp...@gmail.com <hp...@gmail.com> #17
nice! will test and provide feedback once the new versions are released. thanks!
hp...@gmail.com <hp...@gmail.com> #18
sorry for the late feedback. I am done testing androidx.preference:preference:1.1.0-alpha03, and the bug is no longer present. I ran the linked sample project above on three devices: Samsung Galaxy J2 Prime running Android 6.0.1, Samsung Galaxy J2 Pro running Android 7.1.1, and a Samsung Galaxy J4+ running Android 8.1.0.
thanks for the fix!
thanks for the fix!
lb...@gmail.com <lb...@gmail.com> #19
lp...@google.com <lp...@google.com> #20
Seems to be unrelated, will track that issue in that bug.
lb...@gmail.com <lb...@gmail.com> #21
@20 I see. Will there be a new version of those soon, to fix similar issues?
Description
2018-12-31 18:56:12.569 5471-5471/com.supercilex.robotscouter.debug E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.supercilex.robotscouter.debug, PID: 5471
java.lang.NullPointerException: Attempt to invoke interface method 'androidx.preference.Preference androidx.preference.DialogPreference$TargetFragment.findPreference(java.lang.CharSequence)' on a null object reference
at androidx.preference.PreferenceDialogFragmentCompat.getPreference(PreferenceDialogFragmentCompat.java:177)
at androidx.preference.ListPreferenceDialogFragmentCompat.getListPreference(ListPreferenceDialogFragmentCompat.java:76)
at androidx.preference.ListPreferenceDialogFragmentCompat.onDialogClosed(ListPreferenceDialogFragmentCompat.java:104)
at androidx.preference.PreferenceDialogFragmentCompat.onDismiss(PreferenceDialogFragmentCompat.java:267)
at android.app.Dialog$ListenersHandler.handleMessage(Dialog.java:1393)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6680)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)