大佬教程收集整理的这篇文章主要介绍了android – 带自定义ListView的DialogFragment,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
public class MultiSELEctDialogCustom extends DialogFragment { ListView mLOCATIOnList; private ArrayList<String> mOfficeListItems = new ArrayList<String>(); public static MultiSELEctDialogCustom newInstance(int titlE) { MultiSELEctDialogCustom dialog = new MultiSELEctDialogCustom(); Bundle args = new Bundle(); args.puTint("title",titlE); dialog.setArguments(args); return dialog; } @Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceStatE) { Collections.addAll(mOfficeListItems,getresources().getStringArray(R.array.offices)); View v = inflater.inflate(R.layout.fragment_choice_list,container,truE); mLOCATIOnList = (ListView)v.findViewById(R.id.LOCATIOn_criteria_list); final FunctionListArrayAdapter adapter = new FunctionListArrayAdapter( this,android.R.layout.simple_list_item_1,mOfficeListItems); mLOCATIOnList.setAdapter(adapter); getDialog().settitle(getArguments().geTint("title")); return v; } }@H_403_3@从片段中调用时:
@H_152_2@multiSELEctDialogCustom dialogFrag = MultiSELEctDialogCustom_.newInstance(R.String.dialog_titlE); dialogFrag.show(getActivity().getSupportFragmentManager(),@R_607_6633@@H_403_3@
@Override public Dialog onCreateDialog(Bundle savedInstanceStatE) { Collections.addAll(mOfficeListItems,getresources().getStringArray(R.array.offices)); View v = getActivity().getLayoutInflater().inflate(R.layout.fragment_choice_list,@R_607_6633@ mLOCATIOnList = (ListView)v.findViewById(R.id.LOCATIOn_criteria_list); final FunctionListArrayAdapter adapter = new FunctionListArrayAdapter( this,mOfficeListItems); mLOCATIOnList.setAdapter(adapter); AlertDialog.builder builder = new AlertDialog.builder(getActivity()); builder.settitle(getArguments().geTint("title")).setView(v); return builder.create(); }@H_403_3@DialogFragment documentation page的引用描述了您要做的事情:
以上是大佬教程为你收集整理的android – 带自定义ListView的DialogFragment全部内容,希望文章能够帮你解决android – 带自定义ListView的DialogFragment所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。