jjzjj

presenting

全部标签

android - MVP模式下如何在Presenter中访问指定的 View 组件?

SignUpFragment使用SignUpPresenter和SignUpFragmentinplementsSignUpView。SingUpPresenter扩展了BasePresenter其中BasePresenter:publicabstractclassBasePresenter{privateWeakReferencemView;publicvoidbindView(@NonNullVview){mView=newWeakReference(view);if(setupDone()){updateView();}}publicvoidunbindView(){mView=

android - 在 Android MVP 中,presenter 应该返回一个值吗?

我尝试学习MVP,我有一些问题想问,presenter应该返回一个值吗?像这样:classMainPresenter:BasePresenter(),MainContract.Actions{overridefungetProducts(id:Int):List{//...returnproducts}}interfaceMainContract{interfaceActions{fungetProducts(id:Int):List}}或者像这样:classMainPresenter:BasePresenter(),MainContract.Actions{overridefunge

android - 错误 : Program type already present: android. 支持.v4.os.ResultReceiver

当我尝试将我的应用程序连接到Firebase时出现此错误。下面是app/build.gradle中的依赖dependencies{implementationfileTree(dir:'libs',include:['*.jar'])implementation'androidx.appcompat:appcompat:1.0.0-alpha1'implementation'androidx.constraintlayout:constraintlayout:1.1.0'testImplementation'junit:junit:4.12'androidTestImplementat

android - 为什么我的 BroadcastReceiver 收到两次 ACTION_USER_PRESENT?

我的应用程序需要在用户解锁屏幕时toast,所以我注册了一个BroadcastReceiver来获取list中的ACTION_USER_PRESENTIntent,如下所示:然后我定义了一个这样的类:packagecom.patmahoneyjr.toastr;importandroid.content.BroadcastReceiver;importandroid.content.Context;importandroid.content.Intent;importandroid.util.Log;publicclassScreenReceiverextendsBroadcastRe

android - 错误 : Program type already present: androidx. 核心.R

我在尝试进行发布构建时遇到了这个问题。Build.gradle文件applyplugin:'com.android.application'applyplugin:'kotlin-android-extensions'applyplugin:'kotlin-android'applyplugin:'com.google.gms.google-services'android{compileSdkVersion28defaultConfig{applicationId"com.trevexs.sengaapp"minSdkVersion19targetSdkVersion28versio

Android Intent.ACTION_SCREEN_OFF 和 Intent.ACTION_USER_PRESENT 如何注册呢

ActivityhasleakedIntentReceiverScreenReceiverthatwasoriginallyregisteredhere.AreyoumissingacalltounregisterReceiver()?在我的主要Activity中//RegisterreceiverthathandlesscreenonandscreenofflogicfinalIntentFilterintentScreenfilter=newIntentFilter(Intent.ACTION_SCREEN_ON);intentScreenfilter.addAction(Inte

android - 什么是 "Program type already present"?

当我尝试构建我的项目时,我遇到了这个错误Programtypealreadypresent:android.support.v4.accessibilityservice.AccessibilityServiceInfoCompatMessage{kind=ERROR,text=Programtypealreadypresent:android.support.v4.accessibilityservice.AccessibilityServiceInfoCompat,sources=[Unknownsourcefile],toolname=Optional.of(D8)}我也在堆栈溢

android - 莫克西 : How pass params to Presenter?

这里是我的MVP实现:publicclassOfferDetailsPdfActivityextendsAppCompatActivityimplementsOnPageChangeListener,OfferDetailsPdfMvp.View{privatePdfPresenterImplpresenter;@OverrideprotectedvoidonCreate(@NullableBundlesavedInstanceState){super.onCreate(savedInstanceState);intofferId=0;if(extras!=null){offerId=

android - 带有 EventBus 的 Model View Presenter,如何将事件返回给 Presenter?

我正在使用Model-View-Presenter设计模式和EventBus(Otto)。我实现此模式的全部原因是仅将事件与演示者分离,并让演示者更新View。这是我拥有的一些代码的示例,我将使用获取Events作为示例。(请注意,Events不同于EventBusEvent,意思是Events中的一个Eventcode>是一个类似“爸爸的生日”的事件,但是EventBus中的一个Event是一个总线事件。fragmentpublicclassEventFragmentextendsFragment{privateEventPresentermEventPresenter;//Init

Android UIAutomator 测试 : Count of all elements present in the list view

在使用AndroidUIAutomator进行移动UI自动化测试时,我需要找出ListView中存在的所有元素。通过使用如下所示的“getChildCount()”方法,我得到了当前可见元素的计数仅,但是更多元素出现在ListView中但不可见。示例代码如下://CreatedUIObjectforlistviewUiObjectlistview_elements=newUiObject(newUiSelector().className("android.widget.ListView"));//PrintingthenumbmerofchildementspresentintheL