草庐IT

first-understand-your-screen

全部标签

android - 帮助解决 PR​​OXIMITY_SCREEN_OFF_WAKE_LOCK 在 Android 中的问题

我在我的应用中启用了接近唤醒锁,它会在接近传感器检测到某些东西时关闭屏幕。但是当屏幕重新唤醒时出现了一个问题——它进入了锁屏界面,而不是我的应用程序。无论屏幕关闭的时间如何(即使传感器在几秒钟后被清除),都会发生这种情况。这是我使用的代码:intPROXIMITY_SCREEN_OFF_WAKE_LOCK=32;mProximityWakeLock=pm.newWakeLock(PROXIMITY_SCREEN_OFF_WAKE_LOCK,LOG_TAG);if(!mProximityWakeLock.isHeld()){mProximityWakeLock.acquire();}有什

git pull Your configuration specifies to merge with the ref ‘refs/heads/xxxx‘ from the remote, but n

$gitpullYourconfigurationspecifiestomergewiththeref'refs/heads/xxxx'fromtheremote,butnosuchrefwasfetched.1.问题原因分析2.问题解决Yourconfigurationspecifiestomergewiththeref‘refs/heads/xxxx’fromtheremote,butnosuchrefwasfetched.)1.问题原因分析1.主要是因为网页上仓库fork别人的,更新了就没了分支,但是本地还有2.需要切换到丢失的分支下,需要先解锁:gitbranch--unset-ups

android - Android 中的 <compatible-screens>

美好的一天,我正在尝试将屏幕尺寸限制为仅适用于GooglePlay中的手机(即不是平板电脑)。在我找到这个article之后我将此添加到我的list文件中:但是现在5.5++英寸手机的用户似乎无法安装我的应用程序。接下来我也找到了这个article和里面的图片:我的第一个问题-是否可以通过特定的英寸值来限制屏幕尺寸,或者我只能使用小、普通、大和超大等标签?在某些时候,我决定通过像这样更新list来将支持的英寸大小增加到7:但是5.5寸甚至5.2寸的用户还是无法安装app。那么我的第二个问题-我做错了什么或不明白?老实说,我阅读了所有关于stackoverflow的类似问题和androi

java - Libgdx : setting another screen, 但旧屏幕上的按钮仍处于 Activity 状态

在我的libgdxgame中,我有2个屏幕,menu和list。当我在menu屏幕中单击label时,我会执行setscreen(list)。新屏幕出现,菜单屏幕及其标签消失。但是当我点击相同的位置时(从标签所在的菜单屏幕,但当然这些标签没有显示,因为我已经改变了屏幕)点击事件响应。为什么?注意:我的列表屏幕目前没有任何小部件的事件处理程序。当切换屏幕时,我需要做的不仅仅是setscreen(anotherscreen)来停用旧屏幕吗? 最佳答案 我改变了这个:我使用该屏幕的阶段变量将输入处理器移动到该屏幕的show()方法publ

android - Cordova 平台添加 android 给出错误 : Your android platform does not have Api. js

我已经在windows8.1中将cordova更新到7.0.1当我使用此命令添加平台时创建项目后cordovaplatformaddandroid它给了我以下错误UsingthisversionofCordovawitholderversionofcordova-androidisdeprecated.Upgradetocordova-android@5.0.0ornewer.Error:YourandroidplatformdoesnothaveApi.js我试图在论坛上搜索它,但没有得到解决。 最佳答案 我认为您的cordova

android - 无法启动快捷方式 : Application is not installed on your phone

我正在尝试为我的AndroidActivity之一创建桌面快捷方式。我使用的代码适用于我读过的每个tuto示例:finalIntentshortcutIntent=newIntent(Intent.ACTION_MAIN);ComponentNamename=newComponentName(getPackageName(),".MyActivity");shortcutIntent.setComponent(name);shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);shortcutIntent.addFlags(Inte

java - 返回到 First/Main Activity 而不重新加载它

我正在开发一个安卓应用。我需要在不重新加载的情况下调用我的MainActivity,因为它从Internet获取了大量数据。假设,我现在正在进行第三个Activity,我想回到MainActivity。如果我使用:Intenti=newIntent(Third.this,Main.class);i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);startActivity(i);它将加载MainActivity,但我不想重新加载它。就像我在第二个Activity中调用finish()一样,它确实满足我的需要。 最佳答案

android - 在 Android 10 上崩溃(布局/abc_screen_simple 行 #17 中的 InflateException)

我的应用程序从Android4.3到Android9Pie都可以正常运行,但我的应用程序无法在Android10(QAPI29)上运行并崩溃。这是我的logcat-为什么会这样?java.lang.RuntimeException:UnabletostartactivityComponentInfo{ir.mahdi.circulars/ir.mahdi.circulars.MainActivity}:android.view.InflateException:BinaryXMLfileline#17inir.mahdi.circulars:layout/abc_screen_simp

【模型部署】Andriod stdio报错:app:checkDebugAarMetadata Your project has set “andriod.useAndriodX=true““

项目场景:最近在做深度学习模型的手机部署,因为初次使用Andriod模型,所以遇到了不少bug。问题描述具体报错如下:看起来有很多错误,其实都是第一个感叹号引起的。点开感叹号,能看到:其实这里已经告诉了我们报错原因和解决方法:Yourprojecthassetandroid.useAndroidX=true,butconfiguration:app:debugRuntimeClasspathstillcontainslegacysupportlibraries,whichmaycauseruntimeissues.ThisbehaviorwillnotbeallowedinAndroidGra

android - 在 Activity 中保持屏幕开启 - 不适用于 FLAG_KEEP_SCREEN_ON

很长一段时间我都认为我知道如何阻止屏幕进入休眠模式,我只是在我的Activity中使用了这段代码:getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);但是,我意识到这仅在我的手机处于“开发者模式”时有效,即当启用/选中USB调试(设置-->开发者选项-->USB调试)时。然后上面的代码确实停止了屏幕/设备进入休眠状态。如果不检查调试,那么我的屏幕就会进入休眠状态,就像没有明天一样。我在我的设备上运行Android4.04,并且android:minSdkVersion="12"android:targ