草庐IT

name-binding

全部标签

android - Dagger 2.11 - 组件中存在具有匹配键的绑定(bind)

我有一个小场景,我有以下结构,我试图在baseActivityFragment中注入(inject)fragment管理器,但由于某种原因我运气不佳:(@Singleton@Component(modules={AppModule.class,ActivityModule.class,AndroidSupportInjectionModule.class})publicinterfaceAppComponentextendsAndroidInjector{@Overridevoidinject(Appapplication);@Component.BuilderinterfaceBui

android - 如何在 android 数据绑定(bind)中使用逻辑操作?

在我的布局文件中,我尝试使用以下语法来指定TextView中的文本:android:text="@{user.isMe()&&user.status.isEmpty()?@string/EmptyStatusHint:user.status}"/>我得到:[FatalError]fragment_user_profile.xml:142:58:Theentitynamemustimmediatelyfollowthe'&'intheentityreference.在DataBindingGuide没有什么特别之处。所以,对于这种情况,我有两个问题:如何使用xml中的逻辑语句进行数据绑定

Android 数据绑定(bind) DatabindingUtil 与绑定(bind)类

我想知道以下内容之间有什么区别:binding=DataBindingUtil.inflate(inflater,R.layout.drawer_item_primary,parent,false);对比binding=DrawerItemPrimaryBinding.inflate(inflater,parent,false);有任何性能差异吗?每个的首选用例是什么?任何其他信息将不胜感激!谢谢! 最佳答案 按照AndroidDocumentation中的建议使用绑定(bind)类的inflate.在DataBindingUtil

android - fragment 错误中的 butterknife @bind

我按照网站上的说明进行操作:http://jakewharton.github.io/butterknife/错误:java.lang.RuntimeException:无法启动ActivityComponentInfo。java.lang.RuntimeException:无法绑定(bind)com.project.myapp.OneFragment的View。我尝试删除@Bind(R.id.btnNext)ButtonbtnNext;并且没有运行错误。publicclassOneFragmentextendsFragment{@Bind(R.id.btnNext)Buttonbtn

以编程方式添加到 LinearLayout 的单个 View 上的 Android 数据绑定(bind)?

我能够毫无困难地获得“Activity范围内”的数据绑定(bind)。但是,当我尝试为特定View设置绑定(bind)时,比如我以编程方式添加到LinearLayout的膨胀View,我尝试过的任何东西都不起作用。例如,将数据绑定(bind)到Activity的View是微不足道的。通常在onCreate()方法中,只需添加:MainActivityBindingbinding=DataBindingUtil.setContentView(this,R.layout.main_activity);Useruser=newUser("Test","User");binding.setUs

android - 如何用值 "No resource found that matches the given name (at ' 修复 '@integer/google_play_services_version' 值')”

当我在VisualStudio2015中构建我的Android应用程序项目时出现以下错误。Noresourcefoundthatmatchesthegivenname(at'value'withvalue'@integer/google_play_services_version')这些行位于:obj\Debug\android\manifest\AndroidManifest.xml在AndroidManifest文件中有3个完整的内容。我已经从SDKManager下载了googleplay服务。我应该在我的解决方案中引用任何内容吗?我已经对Xamarin.GooglePlaySer

android cordova phonegap config.xml 未绑定(bind)前缀

我的Android应用程序有以下config.xml文件,我正在尝试安装launchmyapp插件。每次清理时,都会出现以下错误/code/platforms/android/res/xml/config.xml:21:error:ErrorparsingXML:unboundprefix我检查了其他堆栈问题,每个人都指出参数字段中的格式错误,但一切似乎都正常...这是config.xmlMyAppNameAsampleApacheCordovaapplicationthatrespondstothedevicereadyevent.ApacheCordovaTeam

安卓错误 : Error: No resource found that matches the given name

我是android的新手,所以这个问题可能很幼稚。我正在尝试构建一个包含两个并排列表的布局。当我有一个列表时它工作正常,但是当我添加第二个列表时,我收到此错误。我的View扩展了Activity而不是ListActivity。但我就是想不通为什么我的构建会因为这个错误而失败:\main.xml:13:error:Error:Noresourcefoundthatmatchesthegivenname(at'id'withvalue'@android:id/selected_list').\Android\android-sdk\tools\ant\build.xml:598:Thefo

android.database.sqlite.SQLiteException : no such column: aa: , 编译时:Select Name from stud Where Address=aa

我正在尝试从androidsqlite数据库中检索数据,但它的givine异常是没有这样的列:SqliteSelectQuery是-:c=db.rawQuery("SelectNamefromstudWhereAddress="+a,null);异常(exception):-07-0418:07:00.888:I/Database(648):sqlitereturned:errorcode=1,msg=nosuchcolumn:aa07-0418:07:00.910:D/AndroidRuntime(648):ShuttingdownVM07-0418:07:00.910:W/dalv

Android - fragment 中的绑定(bind)服务

我有一个Activity类,在它的onResume部分我使用了下一个代码-@OverrideprotectedvoidonResume(){super.onResume();bindService(newIntent(MainActivity.this,IMService.class),mConnection,Context.BIND_AUTO_CREATE);}在onPause我使用了下一个代码-@OverrideprotectedvoidonPause(){unbindService(mConnection);super.onPause();}如您所知,我正在绑定(bind)和解除