I have a DialogFragment which serves as a popup. This DialogFragment has a ListView in it and that uses a BaseAdapter that has custom TableRow. My problem is, it takes about 2 seconds to display the popup fully. Is there any solution, or recommendation that you can give me to display this popup faster.
More details : The TableRow has 2 ImageViews and 3 custom TextViews. The BaseAdapter processes the View because it has to do some stuff like hiding other View, setting texts, etc.
Any help will be appreciated. Thanks! :D
I also had many issues with DialogFragment and in our company we decided to abandon it. The main problem is it needs some time to infiltrate and do Fragment stuff. But before it appears user can interact with screen. E.g. press button multiple times before the popup appears and may lead to unexpected behaviors, you have to consider in your code.
Instead use normal Dialog and set Content View - a custom layout and other parameters
    Dialog dialog = new Dialog(context);
    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    dialog.setContentView(R.layout.progress_dialog);
    dialog.setCancelable(false);
    Window window = dialog.getWindow();
    if (window != null) {
        window.setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
    }
    dialog.show();
It helps avoid problems connected with Fragments, Fragment Transactions, State and many others.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With