The method dismissDialog(int) from the type Activity is deprecated
|
The method
What's the reason? and how to solve it? |
|
7down voteaccepted
|
What's the reason? http://developer.android.com/reference/android/app/Activity.html#showDialog(int) Android DialogFragment vs Dialog How to solve it? Use the new DialogFragment class with FragmentManager instead; this is also available on older platforms through the Android compatibility package. http://android-developers.blogspot.in/2012/05/using-dialogfragments.html |
|
Google recommends that we use |
||||
|
Yes use With regards handling events in your fragment there would be various ways of doing it but I simply define a message In the dialog hold a message and instantiate it in the constructor:
Implement the `onClickListener' in your dialog and then call the handler as appropriate:
Edit And as
Then in
|
|||||||||||||||||||||
|
|
I would recommend using Sure, creating a "Yes/No" dialog with it is pretty complex considering that it should be rather simple task, but creating a similar dialog box with (Activity lifecycle makes it complicated - you must let The nice thing is that you can usually build your own abstraction on top of |
|||||||||||||||||
|
Use DialogFragment over AlertDialog:
|
|||
|
You can create generic DialogFragment subclasses like YesNoDialog and OkDialog, and pass in title and message if you use dialogs a lot in your app.
Then call it using the following:
And handle the result in |
|||||||||||||||||||||
|
The method dismissDialog(int) from the type Activity is deprecated的更多相关文章
- hibernate3和4中 HibernateSessionFactory中不同之处 The method applySettings(Map) from the type ServiceRegistryBuilder is deprecated - The type ServiceRegistryBuilder is deprecated
hibernate3和4中 HibernateSessionFactory中不同之处 //serviceRegistry = new ServiceRegistryBuilder().applySet ...
- .replace(R.id.container, new User()).commit();/The method replace(int, Fragment) in the type FragmentTransaction is not app
提示错误:The method replace(int, Fragment) in the type FragmentTransaction is not applicable for the arg ...
- 错误:The method replace(int, Fragment) in the type FragmentTransaction is not applicable for the arguments (int, MyFragment)
Fragment newfragment =new MyFragment();fragmentTransaction.replace(R.layout.activity_main,newfragmen ...
- The method replace(int, Fragment, String) in the type FragmentTransaction is not applicable for the arguments (int, SettingFragment, String)
The method replace(int, Fragment, String) in the type FragmentTransaction is not applicable for the ...
- The method setPositiveButton(int, DialogInterface.OnClickListener) in the type AlertDialog.Builder is not applicable for the arguments
The method setPositiveButton(int, DialogInterface.OnClickListener) in the type AlertDialog.Builder i ...
- The method makeText(Context, CharSequence, int) in the type Toast is not applicable for the arguments (new View.OnClickListener(){}, String, int)
package comxunfang.button; import android.support.v7.app.ActionBarActivity; import android.os.Bundle ...
- delete attempted to return null from a method with a primitive return type (int)
今天被自己给蠢死了 今天在代码中遇到这个错误, 百度翻译一下:映射方法,从一org.system.mapper.child.chmorganizationexaminationmapper.delet ...
- attempted to return null from a method with a primitive return type (int).
java接口文件 package com.cyb.ms.mapper; import org.apache.ibatis.annotations.Param; public interface Acc ...
- The method setPositiveButton(int, DialogInterface.OnClickListener) in the type AlertDialog.Builder i
参考资料: http://blog.csdn.net/competerh_programing/article/details/7377950 在创建Dialog的时候,出现: The method ...
- Mapper method 'com.xxxx.other.dao.MyDao.getNo attempted to return null from a method with a primitive return type (int)
使用myBatis调用存储过程的返回值,提示错误信息: org.apache.ibatis.binding.BindingException: Mapper method 'com.xxxx.othe ...
随机推荐
- 韩顺平Spring体系化笔记(内含ioc,aop,动态代理等底层原理)
Spring Spring 核心学习内容 IOC.AOP. JdbcTemplate.声明式事务 1.Spring 几个重要概念 Spring 可以整合其他的框架(Spring 是管理框架的框架) S ...
- navicate的安装使用
1 navicat概述 Navicat for MySQL 是管理和开发 MySQL 或 MariaDB 的理想解决方案. 这套全面的前端工具为数据库管理.开发和维护提供了一款直观而强大的图形界面. ...
- 深入了解ApacheZeppelin:如何构建高效的数据科学平台
目录 引言 随着数据科学和人工智能的快速发展,如何构建高效的数据科学平台已经成为一个重要议题.Apache Zeppelin是一个开源的数据科学平台,其提供了一种简单.高效的方式来处理和存储数据,并且 ...
- Bean生命周期的扩展点:Bean Post Processor
摘要:在本篇文章中,我们将深入探讨Spring框架中的重要组件--BeanPostProcessor.首先,我们将了解其设计理念和目标,然后通过实际的例子学习如何基础使用它,如何通过BeanPostP ...
- 10/28-29_String类_SrtingBuffer类_Interger类_笔记
API:应用程序编程接口 String功能 public String replace (char oldchar ,char newchar); //符串中某一字符被一新字符替换 public St ...
- git 出现 连接超时443的情况
解决 Failed to connect to github.com port 443:connection timed out 1)取消代理 git config --global --unset ...
- 论文翻译: FREEVC:朝着高质量、无文本、单次转换声音的目标迈进
原文:FREEVC: TOWARDS HIGH-QUALITY TEXT-FREE ONE-SHOT VOICE CONVERSION 原文地址:https://ieeexplore.ieee.org ...
- 【技术实战】Vue技术实战【四】
需求实战一 效果展示 代码展示 <template> <ARow> <ACol> <a-statistic-countdown :value="de ...
- 利用Redis实现向量相似度搜索:解决文本、图像和音频之间的相似度匹配问题
在自然语言处理领域,有一个常见且重要的任务就是文本相似度搜索.文本相似度搜索是指根据用户输入的一段文本,从数据库中找出与之最相似或最相关的一段或多段文本.它可以应用在很多场景中,例如问答系统.推荐系统 ...
- SQL: Unknown collation: 'utf8mb4_0900_ai_ci'
错误原因 字符集错误,我的版本是5.7,文件中是8.0 解决方案 替换字符集 utf8mb4_0900_ai_ci替换为utf8_general_ci utf8mb4替换为utf8 注意:注释中的部分 ...

android