草庐IT

simple_bind_s

全部标签

android - 代码 fragment 的 Mvvmcross 绑定(bind)子项

我在使用Xamarin中的MvvMCross绑定(bind)fragment代码时遇到了一些问题。首先是我想做什么或我做什么:我希望我的解释没问题。我从最低的元素开始。首先,我构建我的UI动态。我有很多"template"。它们定义了我的fragmentfragment,例如标签和ACTextEdit-Field。然后我有很多fragment(我的观点)。它们包含此代码fragment在一个单独的类中,我将fragment添加到fragment中并为它们提供唯一的ID我的基础是使用Fragments和ViewPagerwithMvx的教程。Ostebaron的:http://blog.

android aidl无法绑定(bind)到服务,当主机安装在客户端之后

我有一个aidl服务,在安装主机之前,它可以正常工作,直到安装了客户端,但是正如我在标题中提到的,当主机没有安装时,我安装了客户端,然后我安装了主机在bindService()上获取SecurityExceptionIntentserviceIntent=newIntent(AidlService.class.getName());if(!mContext.getPackageManager().queryIntentServices(serviceIntent,0).isEmpty()){mContext.bindService(serviceIntent,mServiceConn,

android - 使用绑定(bind)膨胀布局时出现 MVVMCross 异常

我正在使用Xamarin和MVVMCross开发一个安卓应用。我在尝试扩充旨在为用户提供选择列表的布局时遇到以下异常。我该如何解决或解决这个问题异常:Cirrious.CrossCore.Exceptions.MvxException:在MvxAdapter创建期间bindingContext为null-只有当特定绑定(bind)上下文已放置在堆栈上时,才应创建适配器来源:varalertBuilder=newAlertDialog.Builder(this);varview=LayoutInflater.Inflate(Resource.Layout.HeadPartSelectio

android - 使用数据绑定(bind)设置千位分隔符格式

我有一个如下所示的ViewModel:publicclassOrderViewModel{doubleprice=23748.89;}以及我将OrderViewModel绑定(bind)到的布局:使用的格式化字符串如下所示:%+.2f$它很好地添加了$符号并将浮点表示形式减少到2位小数。结果看起来像1234.89现在我想用逗号替换小数点并添加千位分隔符,使我的价格看起来像1.234,89我可以只使用我的XML格式化字符串来完成此操作,还是必须在java代码(我的ViewModel)中进行格式化? 最佳答案 试试这个格式字符串:%,.

android - Android 中的静态数据绑定(bind) [文字]

我创建了包含图像和标题的自定义布局。为了重用这个布局,我使用了标签。问题是我什至无法将字符串文字绑定(bind)到包含的布局中。我试着按照这些instructions,但没有成功。layout/titlebar.xml-->-->layout/otherlayout.xml...在gradle中,我为模块启用了数据绑定(bind):android{...dataBinding{enabled=true}...} 最佳答案 根据@CzarMatt的回答修复了layout/otherlayout.xmltagso{LayoutName}

android - 数据绑定(bind)适配器。如何通过 id 引用获取 View ?

我想将View引用指定为ImageView的属性@BindingAdapter(value={"imageUrl","progressView"},requireAll=false)publicstaticvoidsetImageUrl(ImageViewimageView,Stringurl,@IdResintprogressBar){Contextcontext=imageView.getContext();ViewprogressView=imageView.getRootView().findViewById(progressBar);progressView.setVisib

android - 无法使用 lambda 找到数据绑定(bind)事件的方法

到目前为止,我已经使用::符号(即android:onClick="@{vm::doIt}")处理事件,但这需要doIt有不必要的View参数,我最终忽略了未使用的警告。我试图清理它并移动到lambda事件符号(即`android:onClick="@{()->vm.doIt()},但是编译器抛出异常。layout.xmlvm.buttonClicked()}"android:text="@{vm.buttonText}"app:layout_constraintTop_toTopOf="parent"app:layout_constraintEnd_toEndOf="parent"a

android - 绑定(bind)到服务(如果存在)

我正在从事一个项目,如果该服务正在运行,则需要一个Activity来连接到本地服务,如果该服务没有运行,则启动它。这种方法的合适标志是什么。 最佳答案 这很简单,例如,将最后一个参数中的0传递给#bindService(Intent,ServiceConnection,int)。例如bindService(newIntent(this,MrMeService.class),newServiceConnection(){publicvoidonServiceDisconnected(ComponentNamename){System.

java - validator 异常 : bind failure on AVD

我正在尝试创建一个使用Google的OAuth库的Android应用程序,likethissample.但是,当我调用getAuthTokenByFeatures时,我得到一个异常,在LogCat上打印出来:05-2410:56:58.224:W/System.err(557):android.accounts.AuthenticatorException:bindfailure05-2410:56:58.236:W/System.err(557):atandroid.accounts.AccountManager.convertErrorToException(AccountMana

android - 绑定(bind)到 Android 服务的问题

我已经创建了一个名为LocalService的服务,我想绑定(bind)到它以便它可以执行一些操作并将结果返回给调用客户端。我一直在尝试获取exampleoftheandroiddevsite可以工作,但eclipse在此方法上给出编译时错误:voiddoBindService(){//Establishaconnectionwiththeservice.Weuseanexplicit//classnamebecausewewantaspecificserviceimplementationthat//weknowwillberunninginourownprocess(andthus