草庐IT

create_default_context

全部标签

android - 在 Android Studio 中生成 "Created by.."模板的快捷方式?

我有一个包含很多类的项目,我需要在其中更改Createdby模板。/***Createdbyjohnnyfivedevon19.07.16.*/因为有很多这样的类,复制和粘贴不是一种选择。相反,我想删除生成的模板并重新生成它。是否有执行此操作的默认快捷方式?如果没有,那么我该如何创建一个? 最佳答案 RatherIwanttoremovethatgeneratedtemplateandregenerateit.您当然可以编辑模板,但不能重新生成它。我建议为您将来的使用编辑模板,并为在此模板更改之前创建的模板创建一个实时模板。编辑模板

android - org.koin.android.error.MissingAndroidContextException : when try to test app with context

我想为koin编写测试。我使用RoomDatabase,它在构造函数中接收上下文。应用运行良好但测试失败Can'tresolveApplicationinstance.PleaseuseandroidContext()functioninyourKoinApplicationconfiguration. 最佳答案 如果你想在你的模块中使用上下文,你应该在你的startkoin方法中传递上下文//startKoin!startKoin{//declareusedAndroidcontextandroidContext(this@MyA

android - Intent : default application option not shown

我正在使用Intent让用户选择Android设备上的现有图像。使用以下或类似的代码,createChooserIntent确实显示了用于选择设备上的图像(ASTRO、Gallery等)的多个选项,但没有显示“默认情况下用于此操作”复选框。Intentintent=newIntent();intent.setType("image/jpg");intent.setAction(Intent.ACTION_GET_CONTENT);startActivityForResult(Intent.createChooser(intent,"SelectPicture"),PICK_IMAGE)

android - 未为类型 Context 定义方法 getSupportFragmentManager()

错误ThemethodgetSupportFragmentManager()isundefinedforthetypeContext当我在我的oncreateview中使用getSupportFragmentManager()时发生。使用了不同的上下文类型引用来克服这个错误,但这些都不起作用:例如globalContext=container.getContext();globalContext=getActivity().getApplicationContext();getSupportFragmentManager()只能在FragmentActivity中设置。我的问题是是否有

android - 名称为 [DEFAULT] 的 FirebaseApp 不存在并出现错误

您好,我正在尝试获取有关Android后台服务的数据。但是我收到了这个错误。这是我的代码:publicclassFirebaseBackgroundServiceextendsService{FirebaseDatabasedatabase=FirebaseDatabase.getInstance();privateValueEventListenerhandler;DatabaseReferencemyRef=database.getReference("chats");@Nullable@OverridepublicIBinderonBind(Intentintent){retur

java - 安卓 : openConnection() throws IOExeption ( Unable to find default handler for protocol: http )

我有一个使用jcifs库的android应用程序。每次我尝试使用HTTP协议(protocol)在URL上运行openConnection()时,我都会收到带有以下消息的IOExeption:“无法找到协议(protocol)的默认处理程序:http”。它适用于使用FTP协议(protocol)的URL。经过一番挖掘,我怀疑问题出在jcifs库中。从JCIFS文档中,我发现了以下内容:ThejCIFSNTLMsupportisimplementedasaURLStreamHandlerforHTTPconnections.Thishandler"wraps"thedefaulthand

android - MvvmCross 安卓 : How to create a binding for a subview of a fragment to an arbitrary MvxViewModel?

我找了好久,没有找到符合我目前面临的问题的案例。我有一个包含Android抽屉导航布局的MvxFragmentActivity(MainRootView.cs/.axml)的子类:publicclassMainRootView:MvxFragmentActivity,IFragmentHost{...protectedoverridevoidOnViewModelSet(){base.OnViewModelSet();SetContentView(Resource.Layout.MainRootView);...}在Setup.cs中,我定义了一个自定义Presenter来控制加载新v

android - 数据绑定(bind) : How pass Context in xml to method?

安卓工作室3.0。这里是我的自定义方法:publicstaticintgetTileWidthDpInScreen(Contextcontext){//somecodeherereturntileWidthDp;}这里是我的带有数据绑定(bind)代码的xml文件:结果我得到错误:e:java.lang.IllegalStateException:failedtoanalyze:android.databinding.tool.util.LoggedErrorException:Founddatabindingerrors.databindingerrormsg:cannotfindm

android - 如何修复 React Native 中的 "TypeError: undefined is not an object (evaluating ' _reactNativeCamera.default.constants')”错误?

我正在尝试在我的项目中使用“React-native-camera”库。我实际上已经这样做了50多次,每次在我的Mac和Linux系统上都一切顺利。但现在突然间它不再适用于我的Linux系统并不断生成此错误(尽管适用于mac!)。我检查了所有配置步骤here我尝试将missingDimensionStrategy'react-native-camera','general'添加到appbuild.gradle我试过将maven{url"https://jitpack.io"}和maven{url"https://maven.google.com"}添加到项目build.gradle我已

解决报错 java.sql.SQLNonTransientConnectionException: Could not create connection to database server

启动Spring项目报错java.sql.SQLNonTransientConnectionException:Couldnotcreateconnectiontodatabaseserver.Attemptedreconnect3times.Givingup. atcom.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:110) atcom.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) atcom.mysql.c