Issue
I just upgraded to Bumblebee (2021.1.1). Now this line of code:
Navigation.findNavController(v).navigate(R.id.TakeATourActivity, null, null, new DynamicExtras(installMonitor));
shows as an error in the editor (it hasn't been touched in a while). I get the red squiggle under the new DynamicExtras(installMonitor) portion of the code. The error message says:
'navigate(int, android.os.Bundle, androidx.navigation.NavOptions, androidx.navigation.Navigator.Extras)' in 'androidx.navigation.NavController' cannot be applied to '(int, null, null, androidx.navigation.dynamicfeatures.DynamicExtras)'
But this doesn't make sense to me. The signature I'm using is:
public void navigate(@IdRes int resId,
@Nullable android.os.Bundle args,
@Nullable androidx.navigation.NavOptions navOptions,
@Nullable androidx.navigation.Navigator.Extras navigatorExtras)
And the DynamicExtras class does in fact implement Navigator.Exras, so...what's going on? Since it completes a full rebuild with no errors (although the squiggly line is still there), I'm assuming this is some sort of lint problem?
Solution
I just suspect that this is a lint issue (since full build completes successfully), and ended up refactoring this code anyway to use on-demand download of the feature module instead of Dynamic download.
Answered By - tfrysinger
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.