最近,我已更新到Android Studio 3.5。我有三个视图:名为sample.xml文件的垂直LinearLayout(ViewGroup)中的EditText,TextView和Button。当我按ctrl + alt + L格式化内容时,所有视图都会自动重新排列。在我的情况下,位于底部的Button视图在格式化后已到达顶部,位于第一和第二顶部的EditText和TextView也分别在垂直LinearLayout中分别排在第二和第三位置。
Android Studio:3.5
Android Gradle插件:3.5.0
摇篮:5.4.1
JRE:1.8.0_202-release-1483-b03x64
作业系统:Windows 8.1(amd64)v6.3
为 Android Tv 构建一个应用程序,当我想在我的电视或 Fire Stick 上使用调试时,它说它尚未签名?但我还没有完成该应用程序..
尝试了一些 adb 步骤来连接到电视,但设备不可用添加了我的火棒,它要求 RSA 密钥,但由于应用程序未签名而无法启动?
无需代码
安装没有成功。无法安装应用程序:INSTALL_PARSE_FAILED_NO_CERTIFICATES APK 签名验证失败。重试
还通过 Google Cast SDK 开发者控制台注册了我的电视,并支付了 5 美元。
安卓工作室3.5
我们的 QA 检测到一个错误:发生了以下与 RecyclerView 相关的崩溃:`
java.lang.IndexOutOfBoundsException:检测到不一致。无效的项目位置 2(offset:2).state:3
一个残酷的解决方法可能是在异常发生时捕获异常并从头开始重新创建 RecyclverView 实例,以避免留下损坏的状态。
但是,如果可能的话,我想更好地理解这个问题(也许从源头上解决它),而不是掩盖它。
该错误很容易重现滚动继续快速创建此崩溃,但它发生时是致命的。
我的工作代码是:
public class MoviesGridRecyclerViewDataAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
public static final int VIEW_ITEM = 1;
public static final int VIEW_PROG = -1;
private static final int FADE_DURATION = 500;
int pastVisiblesItems, visibleItemCount, totalItemCount;
private List<VideoEntity> dataList;
private FragmentActivity activity;
private int visibleThreshold = 1;
//private int lastVisibleItem, totalItemCount;
//private boolean loading = false;
private OnLoadMoreListener onLoadMoreListener;
private RecyclerView.OnScrollListener recyclerciewScrollListener;
private RecyclerView recyclerView;
private boolean followLargeItemOnDataRender;
private boolean loading = …Run Code Online (Sandbox Code Playgroud) 有时我会发现这个异常:
Can't create handler inside thread that has not called Looper.prepare()
如何知道是否Looper.myLooper()称为准备?
ps - 我的英语不好
我正在使用此实现:'com.google.vr:sdk-panowidget:1.160.0'为了显示360图像,但出现以下错误;在将应用上传到商店时:
Error
This release is not compliant with the Google Play 64-bit requirement
The following APKs or App Bundles are available to 64-bit devices,
but they only have 32-bit native code: 130.
Include 64-bit and 32-bit native code in your app. Use
the Android App Bundle publishing format to automatically
ensure that each device architecture receives
only the native code that it needs.
This avoids increasing the overall size of your app. Learn More
Run Code Online (Sandbox Code Playgroud)
注意:该库未创建lib / x86_64.so文件。
请帮忙!
我试图在有缺口的 Android 设备上占据尽可能多的可用空间。在Flutter开发过程中,有一个名为的小部件SafeArea,它会根据设备是否有缺口自动调整您的视图。即使在iOS开发中每当我们添加constraintsusing时storyboard,我们也可以根据SafeArea. 但我在 Native Android 开发中找不到类似的东西。
在我的styles.xmlv28 中,我添加了如下内容
<style name="TPAFTheme" parent="@style/Theme.AppCompat.Light.NoActionBar">
<item name="android:windowNoTitle">true</item>
<item name="android:windowActionBar">false</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowContentOverlay">@null</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
<item name="android:windowTranslucentStatus">true</item>
<item name="android:windowTranslucentNavigation">true</item>
</style>
Run Code Online (Sandbox Code Playgroud)
但是是否可以在布局文件本身中检测设备是否有Notch并据此调整布局。我正在Constraintlayout我的应用程序中使用。由于我的应用程序顶部有图像,如果设备顶部有凹口,图像就会被裁剪。任何帮助,将不胜感激。