首页 \ 问答 \ 从自定义DatePicker DialogPreference调用自定义Time DialogPreference(call custom Time DialogPreference from custom DatePicker DialogPreference)

从自定义DatePicker DialogPreference调用自定义Time DialogPreference(call custom Time DialogPreference from custom DatePicker DialogPreference)

我需要在我的项目中实现自定义TimePicker和DatePicker DialogPreferences。 应调用第一个DatePicker对话框,然后调用TimePicker。 在教程和教程的帮助下,我将它们都实现到了我的项目中。

我认为我应该在onDialogClosed方法中调用TimePreference。 我这样做:

    @Override
protected void onDialogClosed(boolean shouldSave) {
    if (shouldSave && this.changedValueCanBeNull != null) {
      setTheDate(this.changedValueCanBeNull);
      this.changedValueCanBeNull = null;
      Log.i("curr context", ctx.getClass().toString());
      try{

          new TimePreference(ctx,attrs).getDialog().show();
      }
      catch(Exception e)
      {
          e.printStackTrace();
      }
    }
}

但是我得到一个NullPointerException。 问题是如何在DatePreference工作之后以编程方式调用我的自定义TimePreference对话框,并将这两个值都设置为DatePreference。 或者我应该创建不同的自定义ListPreference,它应该实现这两个项目?


I need to implement both custom TimePicker and DatePicker DialogPreferences in my project. First DatePicker Dialog should be called and then TimePicker. I implemented them both to my project with the help of this and this tutorials.

I think that I should call TimePreference in the onDialogClosed method of the DatePreference. I do it like that:

    @Override
protected void onDialogClosed(boolean shouldSave) {
    if (shouldSave && this.changedValueCanBeNull != null) {
      setTheDate(this.changedValueCanBeNull);
      this.changedValueCanBeNull = null;
      Log.i("curr context", ctx.getClass().toString());
      try{

          new TimePreference(ctx,attrs).getDialog().show();
      }
      catch(Exception e)
      {
          e.printStackTrace();
      }
    }
}

But I get an NullPointerException. Question is how can I call my custom TimePreference dialog programatically right after the DatePreference work and set both values to the DatePreference. Or I should create different custom ListPreference which should implement both of that items?


原文:https://stackoverflow.com/questions/14984584
更新时间:2023-12-14 14:12

最满意答案

GitHub是一个存储库托管服务,您确实需要提交,并首先将您的源推送到GitHub存储库,然后应用标记。

然后,您可以将版本与该标记关联:请参阅“ 创建版本

这将是允许您发布“应用程序”(意味着可执行交付)的部分。

https://help.github.com/assets/images/help/releases/releases_adding_binary.gif

目标是在以下两者之间建立强有力的联系:

  • 特定版本的源代码(通过标签)
  • 交货(从所述来源建立)

GitHub being a source repository hosting service, you need indeed to commit, and push your sources to a GitHub repo first, and apply a tag.

Then, you would be able to associate a release to that tag: see "Creating a release"

That would be the part which allows you to publish an "application" (meaning an executable delivery).

https://help.github.com/assets/images/help/releases/releases_adding_binary.gif

The goal is to keep a strong link between:

  • a specific version of the source code (through the tag)
  • a delivery (built from said sources)

相关问答

更多
  • “AI引擎”可能意味着很多不同的事情。 你在找什么样的“AI”? 以下是一些机器学习软件的列表 。 其中许多是开源的(链接页面显示许可证)。 "AI engine" can mean an awful lot of different things. What kind of "AI" are you looking for? Here is a list of some machine learning software. Many of them are open source (the linked ...
  • 不知道你正在使用什么语言,但是例如在C / C ++中,你可以添加一个包含API密钥的包含文件,然后将其从源代码控制中删除,而不用添加一个虚假的API密钥伪造的文件。 大多数语言有一种或另一种方式来包含文件。 Don't know what language you are using, but for example in C/C++ you'd add a include file with the API keys, and then leave it out of source control, i ...
  • GitHub是一个源存储库托管服务,您确实需要提交,并首先将您的源推送到GitHub存储库,然后应用标记。 然后,您可以将版本与该标记关联:请参阅“ 创建版本 ” 这将是允许您发布“应用程序”(意味着可执行交付)的部分。 目标是在以下两者之间建立强有力的联系: 特定版本的源代码(通过标签) 交货(从所述来源建立) GitHub being a source repository hosting service, you need indeed to commit, and push your sources ...
  • 如果要使用基于Web的开源GIS,请尝试使用OpenGeo Suite 还有几个用于GIS的库,如GeoTools和DotSpatial 。 最后,您可以看到这是开源/免费GIS相关软件项目的完整索引。 If you want to use web based open source GIS, try OpenGeo Suite Also there are several libraries for GIS, like GeoTools and DotSpatial. Finally, you can s ...
  • 如果您不打算分发它,您可以用它做你想做的事。 请参阅GPL常见问题解答中的此条目 。 If you're not going to distribute it, you can do what you want with it. See this entry in the GPL FAQ.
  • 你可以: * Freely use Dojo to build applications and services * Distribute Dojo as a part of commercial products * Modify Dojo, make extensions to the toolkit, and produce your own 附加组件,不要求您提供代码或将其贡献给项目 只需重新进行迭代,您就可以使用Dojo构建商业软件,而无需获得单独的许可或承担任何其他义务。 根据修改后的BSD ...
  • AGPL代表Affero GPL 。 它基本上说,当你想销售包含iText的软件产品或在任何商业Web服务中使用iText时,你需要购买许可证。 如果你使用开放源代码(具有合适的许可证)或私人项目,那么你就没有问题,也不需要购买许可证。 AGPL stands for Affero GPL. It basically says, when you want to sell a software product that includes iText or use iText in any commercia ...
  • 这篇文章可以让你对android的开源软件项目有一个很好的了解 New Total OSS Projects Mobile Growth OSS Projects Associated with a Platform 2009 Projects '08-'09 ------------ ...
  • 我根据BSD许可证开源了我的第一个iPhone应用程序 ,并没有后悔这个决定。 我写这篇文章是为了教自己开发iPhone的细节,并想到我会发布代码来帮助其他人做同样的事情。 我甚至写过几篇关于我在开发这个应用程序时学到的东西的帖子 。 我也使这个应用程序免费和开源,因为它依赖纳税人资助的科学资源,我觉得错误地收取与这种设施相关的任何东西。 您将从中看到的一个好处是您网站的流量。 首先,拥有一个免费的应用程序将为您带来大量的下载和来自好奇用户的大量访问。 自App Store推出以来,我的应用程序已被下载超过 ...
  • 没有开源许可证可以阻止您对软件或服务收费。 GPL简单地说,如果您分发某些GPL软件的修改版本,那么您的修改也必须在GPL下发布。 它并没有说你必须根据你的意愿分发你的修改版本,只有当你这样做时,你必须根据GPL这样做。 “Affero GPL”比这更进一步说明如果您使用AGPL软件来驱动网络服务,那么您必须根据AGPL发布对软件所做的任何修改。 换句话说,提供对服务的公共访问与分发软件的方式相同。 当然,如果您是相关软件(的所有部分)的版权所有者,那么您可以根据您选择的任何许可证自由发布和/或使用它。 您 ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。