草庐IT

background-geolocation

全部标签

java - 如何以编程方式设置android :background ="?android:attr/selectableItemBackground"?

如何以编程方式android:background="?android:attr/selectableItemBackground""?我尝试了mView.setBackgroundResource(android.R.attr.selectableItemBackground);但它没有用。 最佳答案 您需要先解析属性。TypedValuetypedValue=newTypedValue();//IusedgetActivity()asifyouwerecallingfromafragment.//Youjustwanttocal

安卓 5.0 : howto change Overview Screen Task Title background color

新的Android5.0LollipopOverviewScreen每个应用程序的任务都带有屏幕截图和(默认情况下)灰色标题栏。一些Lollipop应用程序(例如新的Play商店)使用不同的颜色。如何更改概览屏幕标题背景的颜色? 最佳答案 一般来说,如果你的目标是Material,那么你应该设置colorPrimary(操作栏,最近),colorPrimaryDark(状态栏)和colorAccent(复选框、进度条等)在您的主题中。也就是说,您可以使用以下方法将最近使用的颜色动态更改为其他颜色:TaskDescriptiontas

android - Samsung Galaxy 设备无法使用 geolocation.getCurrentPosition

好吧,很长一段时间以来,我一直在寻找对这个问题的适当回应。我有一个使用navigator.geolocation.getCurrentPosition获取用户位置的网络应用程序。SamsungGalaxy设备上的native浏览器几乎总是存在getCurrentPosition代码问题。我已经尝试过此代码的各种变体,包括回调和超时,但它始终是同一个问题。很多人都记录了这个问题,有些人表示重启设备会起作用(有时重启确实有效,但并非总是如此-告诉用户重启他们的设备的警报似乎是荒谬的)。有没有人找到在SamsungGalaxy设备上使用getCurrentPosition的可靠方法?这是我正

安卓 : how to know when an app enters or the "background" mode?

我正在尝试通过Android实现以下目标:当应用程序处于后台时,线程会时不时地轮询服务器以检索数据并在有新数据可用时通知用户。我正在为此使用服务,很好。当应用处于“Activity”使用状态时,即其Activity之一可见时,轮询应停止,因为它可能会干扰其他用户操作。我不明白如何检测应用程序“Activity”或“后台”使用之间的转换。onResume()Activity方法似乎没有帮助,因为无论如何在“Activity”使用期间Activity都可以隐藏或可见。我的理解是,应用程序本身并不能区分这两种状态。按下HOME键时可以关联吗?还有其他方法可以区分吗?我正在考虑等效于iPhon

android - 具有表面输入 : Recording in background 的 MediaCodec

我正在开发一个视频编码应用程序,我想防止它在托管Activity进入后台或屏幕循环关闭/打开时停止。我的编码器架构源自优秀的CameraToMpegTest例如,将相机帧显示到GLSurfaceView(参见下面的Github链接)。我目前正在使用双态解决方案进行后台录制:当宿主Activity在前台时,每次调用GLSurfaceView.Renderer的onDrawFrame时编码一个视频帧。这使我可以突发​​访问GLSurfaceView的EGL状态,以免阻塞排队到渲染器线程的其他事件。当托管Activity进入后台时,停止onDrawFrame编码并在循环内的另一个后台线程上对

android - 错误 : app is in background uid null

我在IntelliJCE2017.2上创建了一个新的Android项目并获得了thiserror.我按照答案中的描述添加了Maven部分。当我运行使用新项目创建的默认应用程序时出现错误Errorwhileexecuting:amstartservicecom.test.myapp/com.android.tools.fd.runtime.InstantRunServiceStartingservice:Intent{act=android.intent.action.MAINcat=[android.intent.category.LAUNCHER]cmp=com.test.myapp

android - 使用 Theme.MaterialComponents.Light.NoActionBar 样式时,设置 Button Background 无效

为了使用Chip和ChipGroup,我设置了ApplicationstyleextendsTheme.MaterialComponents.Light.NoActionBarintmanifests.xml,然后我设置了Button"android:background"属性,但它没有影响!为什么?我能做什么?这是我的风格:@color/primary_material_light@color/header_color48dpportrait@style/AntButton-->@style/AntButton-->-->@color/ffc000-->@color/ffc000@d

android - navigator.geolocation.getCurrentPosition 总是得到错误代码 3 : timeout expired

我正在使用cordova-2.0.0和android模拟器googleapilevel16。每当我运行navigator.geolocation.getCurrentPosition时,我总是得到error3。我的代码简介如下://WaitforCordovatoloaddocument.addEventListener("deviceready",onDeviceReady,false);//CordovaisreadyfunctiononDeviceReady(){console.log("Enteringindex.html.onDeviceReady");varnetworkS

android - SearchView on support.v7.appcompat 库问题 : default 9-patch background not renders properly

我正在使用support.v7.appcompat库开发带有ActionBar的应用程序。操作栏有效,显示SearchView,提示显示。唯一的问题是SearchView的背景没有正确缩放。与往常不同的是,它显得很大,并带有9条黑色线条。使用:从命令行开发,使用antdebug编译。在LinuxMageia3上,ant版本:2013年1月11日编译的ApacheAnt(TM)版本1.8.4使用project.properties行链接到库:android.library.reference.1=../../../../../sdk/extras/android/support/v7/a

安卓工具栏 : how to have a toolbar with image in the background and menu items on top

如何使用MaterialDesign创建带有背景图片的工具栏。下面是我想要的:我正在尝试以下代码:我得到的是: 最佳答案 如果您坚持使用ImageView而不是使用.setBackground(...)函数。您可以尝试使用RelativeLayout和Toolbar覆盖ImageView,如下所示: 关于安卓工具栏:howtohaveatoolbarwithimageinthebackgroundandmenuitemsontop,我们在StackOverflow上找到一个类似的问题: