orhanobut / dialogplus

Advanced dialog solution for android
Apache License 2.0
5k stars 793 forks source link

textbox settext not updating before dialog load #202

Open keyvan1361 opened 3 years ago

keyvan1361 commented 3 years ago

Hi, I need to access the elements to settext of a textbox or a set a checkbox before the dialog loads it works fine when i use the code below in the activity to set the text but does not work in a fragment inside a tabLayout in Activity: ` View view = getLayoutInflater().inflate(R.layout.fragment_agent, null); TextView agencyTitle = (TextView) view.findViewById(R.id.agencyTitleTextView);

     executor.execute(new Runnable() {
                                    @Override
                                    public void run() {
                        agencyTitle.setText(agent.getAgencyTitle());

} }); DialogPlus dialog = DialogPlus.newDialog(ListingViewActivity.this) .... but when i use it in a fragment when i log the result it seems to gets the value but it **does not refresh the layout** and see the values !!! in fragment: View myView = LayoutInflater.from(getContext()).inflate(R.layout.fragment_agent, null);

executor.execute(new Runnable() { @Override public void run() { CheckBox chk1 = (CheckBox) myView.findViewById(R.id.checkbox_apartment); chk1.setChecked(true);`

what is wrong here!?