Android Fragment getArguments() returns null

后端 未结 4 385

As the title suggest.
I\'ve downloaded Fragment code from here, http://developer.android.com/shareables/training/FragmentBasics.zip.
It is Fragment exam

4条回答
  •  孤街浪徒
    2020-12-06 12:04

    It looks like you are inserting a key and value pair into your bundle. You probably need to reference the key value as in getArguments().getString(category);

    According to the docs for putString: Inserts a String value into the mapping of this Bundle, replacing any existing value for the given key. Either key or value may be null.

    Parameters key a String, or null value a String, or null

提交回复
热议问题