我在 Windows 10 (1909) 版本上使用 Android studio v 4.0。一切都工作正常,直到昨晚我的代码编辑器窗口消失了。
我尝试了以下
许多其他组件也会受到影响,例如
另一件奇怪的事情是我无法打开设置 [文件 -> 设置](它什么也不显示)
idea.log1 包含此异常
2020-06-27 12:26:01,693 [5987243] ERROR - enapi.editor.impl.SettingsImpl - Error determining tab size
java.lang.NullPointerException
at com.intellij.openapi.editor.impl.SettingsImpl.getTabSize(SettingsImpl.java:377)
at com.intellij.openapi.editor.ex.util.EditorUtil.getTabSize(EditorUtil.java:342)
at com.intellij.openapi.editor.impl.view.EditorView.getTabSize(EditorView.java:547)
at com.intellij.openapi.editor.impl.view.LogicalPositionCache.reset(LogicalPositionCache.java:75)
at com.intellij.openapi.editor.impl.view.EditorView.reinitSettings(EditorView.java:344)
at com.intellij.openapi.editor.impl.EditorImpl.<init>(EditorImpl.java:501)
at com.intellij.openapi.editor.impl.EditorFactoryImpl.createEditor(EditorFactoryImpl.java:200)
at com.intellij.openapi.editor.impl.EditorFactoryImpl.createViewer(EditorFactoryImpl.java:170)
at com.intellij.execution.impl.ConsoleViewUtil.setupConsoleEditor(ConsoleViewUtil.java:56)
at com.android.tools.idea.welcome.wizard.deprecated.ProgressStep.<init>(ProgressStep.java:61)
at com.android.tools.idea.sdk.wizard.VmWizard$SetupProgressStep.<init>(VmWizard.java:132)
at com.android.tools.idea.sdk.wizard.VmWizard$VmPath.init(VmWizard.java:251)
at com.android.tools.idea.wizard.dynamic.DynamicWizardPath.attachToWizard(DynamicWizardPath.java:98)
at com.android.tools.idea.wizard.dynamic.DynamicWizard.addPath(DynamicWizard.java:233)
at com.android.tools.idea.sdk.wizard.VmWizard.<init>(VmWizard.java:68)
at com.android.tools.idea.sdk.install.VmInstallListener.lambda$statusChanged$0(VmInstallListener.java:58)
at com.intellij.openapi.application.impl.LaterInvocator$1.run(LaterInvocator.java:154)
at …Run Code Online (Sandbox Code Playgroud) 我在一些应用程序(不记得名字)中看到,在文本框下,会显示一个小弹出窗口,上面写着
自动填充消息中的代码
我想向我的应用程序添加类似的功能。按照文档中的建议添加自动填充提示并设置自动填充重要性以实现此行为。我都尝试过,但都没有成功。我尝试过以下操作
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/tv_login"
android:layout_marginTop="@dimen/x60"
android:id="@+id/pin"
app:errorEnabled="true"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_centerHorizontal="true">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="PIN"
android:drawablePadding="@dimen/x16"
android:inputType="number"
android:maxLength="6"
android:id="@+id/et_pin"
android:importantForAutofill="yes"
android:autofillHints=".AUTOFILL_HINT_SMS_OTP"
android:drawableStart="@drawable/ic_pin"/>
</com.google.android.material.textfield.TextInputLayout>
Run Code Online (Sandbox Code Playgroud)
我想在我的应用程序中得到这种类型的东西