Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/209.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Android Studio BottomSheetFragment.show错误_Java_Android - Fatal编程技术网

Java Android Studio BottomSheetFragment.show错误

Java Android Studio BottomSheetFragment.show错误,java,android,Java,Android,我试图在有地图的活动中使用底部工作表。然而 public void showBottomSheetDialogFragment() { BottomSheetDetailsFragment bottomSheetFragment = new BottomSheetDetailsFragment(); //This line shows an error in android studio bottomSheetFragment.show(getSupportFra

我试图在有地图的活动中使用底部工作表。然而

public void showBottomSheetDialogFragment() {
       BottomSheetDetailsFragment bottomSheetFragment = new BottomSheetDetailsFragment();

//This line shows an error in android studio
        bottomSheetFragment.show(getSupportFragmentManager(), "TAG");
    }
还有我的床底碎片

public class BottomSheetDetailsFragment extends Fragment {

   public BottomSheetDetailsFragment() {

   }

   @Override
   public void onCreate(@Nullable Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
   }

   @Nullable
   @Override
   public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
       return inflater.inflate(R.layout.fragment_bottom_sheet_details, container, false);
   }


}

我哪里做错了?

请显示LogCatBuild中打印的错误,错误为:找不到符号bottomSheetFragment.show(getSupportFragmentManager(),“TAG”);^symbol:method show(FragmentManager,String)location:bottomsheetdetails Fragment类型的变量bottomSheetFragment Fragment对不起,为什么要从
Fragment
扩展,需要从
BottomSheetDialogFragment
Wow谢谢。这就解决了:)