我正在使用 LiveData 和 viewmodels 构建一个简单的应用程序,但我在我的活动中收到以下警告消息,而不是我的活动中的一些警告
无法访问“androidx.activity.contextaware.ContextAware”,它是“com.example.movies.presentation.home.MoviesActivity”的超类型。检查您的模块类路径是否缺少或冲突的依赖项
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
// ViewModel
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$life_cycle_version"
// LiveData
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$life_cycle_version"
implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
kapt "androidx.lifecycle:lifecycle-compiler:$life_cycle_version"
// Hilt
implementation "com.google.dagger:hilt-android:$hilt_version"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$life_cycle_version"
kapt "com.google.dagger:hilt-android-compiler:$hilt_version"
//moshi
implementation("com.squareup.moshi:moshi:$moshi_version")
kapt("com.squareup.moshi:moshi-kotlin-codegen:$moshi_version")
//retrofit
implementation "com.squareup.retrofit2:retrofit:$retrofit_version"
implementation "com.squareup.retrofit2:converter-moshi:$retrofit_version"
implementation("com.squareup.okhttp3:logging-interceptor:$okhttp_version")
//espresso testing
androidTestImplementation "androidx.test.espresso:espresso-core:$espresso_core"
androidTestImplementation "androidx.test:runner:$test_runner"
androidTestImplementation "androidx.test:rules:$test_runner"
// Hilt For instrumentation tests
androidTestImplementation "com.google.dagger:hilt-android-testing:$hilt_testing"
androidTestAnnotationProcessor "com.google.dagger:hilt-compiler:$hilt_testing"
//Hilt For local unit tests
testImplementation "com.google.dagger:hilt-android-testing:$hilt_testing"
testAnnotationProcessor "com.google.dagger:hilt-compiler:$hilt_testing"
//mockk …Run Code Online (Sandbox Code Playgroud) android gradle android-lifecycle android-studio android-livedata
您好,我正在尝试开发一个使用自定义相机的应用程序,当我尝试使用相机类时,它已被弃用,因此我使用了 android 硬件。相机 2 并遵循本 教程
但是当我尝试添加 CameraDevice.StatecCallBack 时,它给了我一个警告,最小 SDK 应该是 21,我的最小 SDK 是 15 现在我很困惑,如果我使用旧的相机 API,如果我使用新的它不推荐使用它不支持我的最小 SDK 我该怎么办?
我正在尝试将CircleCi与我的Android项目一起使用我添加了circle.yml文件,但每次构建失败并出现以下错误
配置项目':app'时出现问题.找不到Build Tools修订版23.0.1
以下是我的circle.yml文件
#
# Build configuration for Circle CI
#
general:
artifacts:
- /home/ubuntu/ES-NRP-Android-V3/app/build/outputs/apk/
machine:
environment:
ANDROID_HOME: /usr/local/android-sdk-linux
dependencies:
pre:
- echo y | android update sdk --no-ui --all --filter "tools"
- echo y | android update sdk --no-ui --all --filter "build-tools-23.0.1"
override:
- echo y | android update sdk --no-ui --all --filter tools,platform-tools,build-tools-23.0.1,android-23,extra-google-m2repository,extra-google-google_play_services,extra-android-support
- ANDROID_HOME=/usr/local/android-sdk-linux ./gradlew dependencies
test:
override:
- (./gradlew assemble):
timeout: 360
Run Code Online (Sandbox Code Playgroud)
我的目标是SDK版本23和构建工具23.0.2
我试图在我的应用程序中调用api我有以下url模板
test-test.domainname.com/feeds/json/v3/attribute/attribute
我正在使用改造2,但我得到以下致命异常
非法网址:test-test.domainname.com
这是我的界面
public interface Iinterface{
@GET("feeds/json/v3/attribute/"+attribute)
Call<ArrayList<result>>getresult();
}
Run Code Online (Sandbox Code Playgroud)
有人可以帮我解决这个问题......
我正在尝试为视障人士开发一个应用程序,我正在使用辅助功能肯定我试图为用户设置一个欢迎,而无需用户触摸任何应该只在辅助功能模式下播放的活动以及当活动启动时有一个Textview欢迎用户,我已经设置了消息contentDescription和onCreate我打电话的方法
textView.announceForAccessibility("Welcome");
Run Code Online (Sandbox Code Playgroud)
我也试过了
textView.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_CLICKED);
textView.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_FOCUSED);
textView.sendAccessibilityEvent(AccessibilityEvent.TYPE_ANNOUNCEMENT);
Run Code Online (Sandbox Code Playgroud)
几乎每AccessibilityEvent type一个都没有工作我正在测试nexus6p与android v7也启用了辅助功能
我一直在使用网络服务,它工作得很好,然后我补充说 App.config和Web.config中的行为部分中的属性,它崩溃的错误是*
WCF在服务实现的合同列表中找不到合同名称"IMetadataExchange"
,下面你找到我的服务库的App.config的xml代码..在它下面你找到了我网站的web.config文件的xml代码,感谢你的帮助:)我的App.config为我的库
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
<add key="ClientSettingsProvider.ServiceUri" value="" />
</appSettings>
<system.web>
<compilation debug="true" />
<membership defaultProvider="ClientAuthenticationMembershipProvider">
<providers>
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
</providers>
</membership>
<roleManager defaultProvider="ClientRoleProvider" enabled="true">
<providers>
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
</providers>
</roleManager>
</system.web>
<!-- When deploying the …Run Code Online (Sandbox Code Playgroud)