草庐IT

catalog_presenter

全部标签

android - 为什么android.arch.navigation 会导致Program type already present : android. support.v4.os.ResultReceiver$1?

我使用的是AndroidStudio版本AndroidStudio3.2Canary14Build#AI-181.4668.68.32.4763614,builtonMay4,2018JRE:1.8.0_152-release-1136-b02x86_64JVM:OpenJDK64-BitServerVMbyJetBrainss.r.oMacOSX10.11.6在调查新的架构导航组件android.arch.navigation时,我遇到了这个构建失败。AGPBI:{"kind":"error","text":"Programtypealreadypresent:android.sup

【异常】org.apache.logging.log4j.LoggingException: log4j-slf4j-impl cannot be present with log4j-to-slf4

【异常】org.apache.logging.log4j.LoggingException:log4j-slf4j-implcannotbepresentwithlog4j-to-slf4j这个错误表明在你的项目中同时引入了log4j-slf4j-impl和log4j-to-slf4j两个依赖,而这两者是互斥的,不能同时存在。解决这个问题有两种方式:移除冲突的依赖:在你的项目的构建文件(如pom.xml)中,找到引入的依赖列表,检查是否同时引入了log4j-slf4j-impl和log4j-to-slf4j。如果是的话,你可以选择保留其中一个,并移除另一个。排除冲突依赖:如果你的项目中使用了其

android - 如何使用 Espresso 在 Instrumentation 测试中注入(inject) Mocked Presenter of Activity

我已经试了一个星期了。我已经抓取了所有可用的文章,但它们的实现或示例不尽如人意或停留在Espresso测试的步骤。我的Android应用程序遵循MVP架构(并且是在Java中)场景:[仅举一个例子]我有一个使用Dagger2获取HomePresenter的HomeActivity。(在通过HomeComponent中的voidinject(HomeActivityactivity)公开的HomeModule中提供方法。在我的HomeActivity的espressoTest中,我想注入(inject)一个mockpresent。我没有通过AppComponent在AppModule中公

android - Intent.ACTION_USER_PRESENT 未在 HoneyComb 或 ICS(三星)设备上收到

我有一个BackgroundReceiver设置来接收list文件中的android.intent.action.USER_PRESENT,如下所示:我重写的onReceive(Context,Intent)方法非常简单:@OverridepublicvoidonReceive(Contextcontext,Intentintent){if(intent!=null){if(Intent.ACTION_USER_PRESENT.equals(intent.getAction()){//wrapperforLog.d(String,String)Dbug.log("MyBroadcast

android - 如何使用 Dagger2 将 Presenter 注入(inject) View(MVP 模式)

我想使用MVP模式构建Android应用。我有一个fragment(View)和一个演示者类。我想要的基本上是将演示者注入(inject)到fragment中,并将fragment设置为演示者的View(通过View将实现的接口(interface))如何使用依赖注入(inject)(使用Dagger2)轻松​​正确地连接两者?编辑:此外,我希望演示者是一个单例,这样它就能够在方向改变时保持数据和状态 最佳答案 首先你需要定义一个presenter模块:@ModuleclassSearchPresenterModule{@NonNu

android - SQLite : How to join tables and present the cursor using SimpleCursorAdapter

我在Android中使用SQLite已经很长时间了,但这是我第一次执行连接表操作。我对此感到非常沮丧,因为我整天都在研究它。现在我有2个表,FTSProfile和FTSCell,我想使用带有LEFTJOIN的公共(public)键A来连接它们。所以我实现了一系列代码,ContentProvider和Database来执行我想要的。在数据库中,我使用SQLiteQueryBuilder来构建查询,从而获得我想要的游标。我用过:SQLiteQueryBuilderbuilder=newSQLiteQueryBuilder();builder.setTables(FTS_VIRTUAL_TA

java - ACTION_USER_PRESENT、ACTION_SCREEN_ON、ACTION_BOOT_COMPLETED 的广播接收器

我正在创建一个使用广播接收器的类。我想在手机解锁时收到广播。但是有一些问题。请帮帮我。我的Manifest.xml是:-和我的广播接收器类:-publicclassMyReieverextendsBroadcastReceiver{@OverridepublicvoidonReceive(Contextcontext,Intentintent){Log.d("MyReciever","isintentnull=>"+(intent==null));Log.d("MyReciever",intent.getAction()+"");}}尽管其他应用程序和服务正在接收“Screen_on”

android - 错误 : Program type already present: androidx. versionedparcelable.ParcelImpl

我正在尝试添加这个https://github.com/ArthurHub/Android-Image-Cropper但是当我添加它时我得到这个错误“错误:程序类型已经存在:androidx.versionedparcelable.ParcelImpl”我附上了项目gradle和appgradle。(我是android开发的新手,并不完全确定如何修复。)我想这可能与此有关implementation"com.android.support:appcompat-v7:${supportLibVersion}"implementation"com.android.support:desig

Spring Mvc上传文件报错MissingServletRequestPartException:Required request part ‘file‘ is not present两种解决方案

今天写了个SpringMvc上传文件的接口运行后报错 附上接口代码@PostMapping("/upload")publicStringhandleFileUpload(@RequestPart("file")MultipartFilefile){try{//保存上传的文件到服务器byte[]bytes=file.getBytes();Pathpath=Paths.get(Objects.requireNonNull(file.getOriginalFilename()));Files.write(path,bytes);}catch(IOExceptione){e.printStackTra

java - 如何使用 ConnectionService 获取 Call UI Presentation

我正在尝试使用ConnectionService从FCM通知中呈现ConnectionService提供的调用UI。我缺少什么来完成这个?按照https://developer.android.com/guide/topics/connectivity/telecom/selfManaged上的步骤操作我添加了:和当我收到FCM通知时,我会:TelecomManagertelecomManager=(TelecomManager)this.getSystemService(Context.TELECOM_SERVICE);StringpackageName=getApplication