获取
window.B = require './B.coffee'
class A extends window.B
window.instanceA = new A
window.A = A
尝试创建自定义对话框时,在Error:(192, 23) error: no suitable method found for show(ActionBar,String)
method DialogFragment.show(FragmentTransaction,String) is not applicable
(actual argument ActionBar cannot be converted to FragmentTransaction by method invocation conversion)
method DialogFragment.show(FragmentManager,String) is not applicable
(actual argument ActionBar cannot be converted to FragmentManager by method invocation conversion)
此代码中收到错误。
这是我的简要代码:
dialog.show(getSupportActionBar(), "dialog");
请帮我解决这个问题。谢谢你......
答案 0 :(得分:1)
使用FragmentManager
FragmentManager fm;
fm= getFragmentManager();
CustomDialogFragment dialog = new CustomDialogFragment();
dialog.show(fm , "dialog");
答案 1 :(得分:0)
DialogFragment fragment = new DialogFragment();
fragment.show(getSupportFragmentManager(), "dialog");