相关疑难解决方法(0)

android中不推荐使用类型为Activity的showDialog(int)方法吗?

该方法showDialog(int)从类型Activity弃用.

在此输入图像描述

什么原因?以及如何解决?

android dialog android-dialog

9
推荐指数
1
解决办法
3万
查看次数

如何使用FragmentManager替换已弃用的showDialog

我正在使用displayDialog方法...它可以正常工作,但Eclipse向我显示了一个警告:

showDialog(showRetry ? 1 : 0);
Run Code Online (Sandbox Code Playgroud)

方法:

   private void displayDialog(final boolean showRetry) {
                    mHandler.post(new Runnable() {
                        public void run() {
                            setProgressBarIndeterminateVisibility(false);
                            showDialog(showRetry ? 1 : 0);
                        }
                    });
                } 
Run Code Online (Sandbox Code Playgroud)

搜索我发现类似的问题,其中看到现在有可用于避免问题的FragmentManager,但我不明白如何在我的特定场景中修复问题,保持与Froyo和GingerBread的复古兼容性.

你可以帮帮我吗?

完整的类代码是:

 public class Home extends Activity {
        private static final String BASE64_PUBLIC_KEY = "mykeywithoutspaces";

        // Generate your own 20 random bytes, and put them here.
        private static final byte[] SALT = new byte[] {
            -00, 00, 30, -2, -58, -57, 00, -64, 51, 32, -95, -45, 13, …
Run Code Online (Sandbox Code Playgroud)

android deprecated android-fragments

2
推荐指数
2
解决办法
2万
查看次数