好吧,我正在使用 TabActivity 为 api 8 开发和应用程序但我今天发现“此类已弃用。”
所以我们应该使用FragmentActivity从现在开始实现标签?但是当我想显示带有 Activity 的 listview 时呢?我必须使用 ListFragment 吗? (但这是“自:API 级别 11”)
如任何人所见,我对如何继续前进感到困惑。
如果有人能为我提供有关此问题、选项卡、 fragment 和任何其他有用建议的清晰概念,那就太好了(AsyncTaskLoader 仅适用于 api11?)
顺便说一句,我读到 fragment 可以从 api 1 开始使用,但现在我找不到了。请帮助:(
编辑:只需重新更改标题,因为 ListFragment 并未被弃用。如果我不想那样做,请在这里抱歉 newby :D
最佳答案
Well, im developing and app for api 8 with TabActivity but i found out today that "This class is deprecated."
在 Android 中,“已弃用”通常意味着“我们将尽可能长时间地维护它,但您应该考虑有更好的选择”。对于 TabActivity,长期计划是将选项卡放在操作栏中,您可以在 Android 3.x 和更高版本上使用它,在 Android 2.x 上使用类似 ActionBarSherlock 的东西。 .
So we should use FragmentActivity from now to implements tabs?
不一定,尽管它肯定是一个选项。
but what about when i want to show a listview with an activity? do i have t use ListFragment (but this is "Since: API Level 11")
ListFragment 也可在 Android 支持包中获得,与获取 FragmentActivity 的位置相同。
AsyncTaskLoader just for api11?
AsyncTaskLoader 在 Android 支持包中也可用。
It would be great if someone can provide me good and clear concepts about this issues, tabs, fragment and any other useful advice
这将覆盖几百页的书籍。您可以考虑在更具体的地方提出其他问题。
如果您还没有这样做,请阅读:
关于android API TabActivity 弃用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8140691/
简而言之错误:NOTE:Gem::SourceIndex#add_specisdeprecated,useSpecification.add_spec.Itwillberemovedonorafter2011-11-01.Gem::SourceIndex#add_speccalledfrom/opt/local/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91./opt/local/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/rails/gem_dependency.rb:275:in`==':und
从Ruby2.4.0开始,对于使用某些已弃用的功能,会出现弃用警告。例如,Bignum、Fixnum、TRUE和FALSE都会触发弃用警告。当我修复我的代码时,有相当多的代码我希望它保持沉默,尤其是在Rails中。我该怎么做? 最佳答案 moduleKerneldefsuppress_warningsoriginal_verbosity=$VERBOSE$VERBOSE=nilresult=yield$VERBOSE=original_verbosityreturnresultendend>>X=:foo=>:foo>>X=:bar
我正在使用unscoped_associations我的Rails5.0.0.1应用程序中的gem。我收到这个弃用警告:DEPRECATIONWARNING:alias_method_chainisdeprecated.Please,useModule#prependinstead.Frommodule,youcanaccesstheoriginalmethodusingsuper.(calledfromat/home/rhl/myapp/config/application.rb:8)DEPRECATIONWARNING:alias_method_chainisdeprecated.
我有一个要分组的数组,“group_by”函数似乎适合我的情况。http://apidock.com/rails/Enumerable/group_by我在Rails3.2.13中使用它。grouped_array=my_array.group_by(&:my_function)#Assumerun'my_function'haveresult1onelement1,element3andresult2onelement2,element4,then:#grouped_array={#result1=>[element1,element3],#result2=>[element2,el
我一直在关注这篇文章以与工头一起设置puma:https://www.digitalocean.com/community/articles/how-to-set-up-zero-downtime-rails-deploys-using-puma-and-foremanpuma脚本在连接后告诉verify_active_connections!但它在rails4中不可用。注释掉方法调用将使脚本运行但我不确定这是否会泄漏资源.关于这个问题,我能看到的唯一文档是:https://github.com/socialcast/resque-ensure-connected/issues/3但是
当我尝试像往常一样在项目上运行“bundleexeccompasswatch”时,我现在收到此警告:DEPRECATIONWARNINGonline87of/home/hedy/Sites/mywebsite.fr/src/vendor/bundle/ruby/2.3.0/gems/compass-core-1.0.3/stylesheets/compass/css3/_deprecated-support.scss:#{}interpolationnearoperatorswillbesimplifiedinafutureversionofSass.Topreservethecurr
我将我的Rails5.1.4应用更新到了5.2.0。我的一个模型中有以下范围:scope:by_category,lambda{|category_slug|category_ids=Category.find_by(slug:category_slug)&.subtree_idswhere(category_id:category_ids)}由于该范围,Rails返回以下错误:DEPRECATIONWARNING:Dangerousquerymethod(methodwhoseargumentsareusedasrawSQL)calledwithnon-attributeargume
我试图理解这个调用:deprecate:new_record?,:new?它使用了这个弃用方法:defdeprecate(old_method,new_method)class_eval我不太了解这里使用的元编程。但是,这只是别名new_record?方法的另一种方式吗-所以实际上,new_record?仍然可用,但在您使用它时会发出警告?有人愿意解释一下这是如何工作的吗? 最佳答案 好的,所以这里发生的是old_method的所有功能都已被程序员移至new_method。为了使两个名称都指向相同的功能但注意弃用,程序员放入了dep
这个问题在这里已经有了答案:Ruby2.4andRails4stackleveltoodeep(SystemStackError)(3个答案)关闭5年前。我是StackOverflow和Rails的新手,所以我希望这不是一个太幼稚的问题。我正在尝试使用bin/rails服务器在本地运行我的应用程序。当我输入时,我收到以下跟踪信息:=>BootingPuma=>Rails4.2.5applicationstartingindevelopmentonhttp://localhost:3000=>Run`railsserver-h`formorestartupoptions=>Ctrl-Ct
我使用“railss”,但服务器无法启动。我也是刚开始当我重新启动它时,我得到了这个:=>BootingPuma=>Rails5.0.0applicationstartingindevelopmentonhttp://localhost:3000=>Run`railsserver-h`formorestartupoptionsDEPRECATIONWARNING:Sprocketsmethod`register_engine`isdeprecated.Pleaseregisteramimetypeusing`register_mime_type`thenuse`register_com