草庐IT

home-screen-widget

全部标签

安卓 : Relativelayout in Framelayout not showing up (Custom Camera Preview Screen)

我需要与附加图像文件相同的相机预览屏幕:我想在framelayout上设计两个透明布局,所以它看起来像这样,但是当我运行它时只显示相机屏幕(Framelayout)。它没有显示两个相对布局。 最佳答案 给布局文件中的两个RelativeLlayouts添加ids..然后像这样获取View对象RelativeLayoutlayout1=(RelativeLayout)findViewById(R.id.topRelativeLayout);RelativeLayoutlayout2=(RelativeLayout)findViewBy

安卓磨损 : Programmatically Wake Screen

有谁知道我将如何唤醒Wear屏幕?我正在运行振动API:Vibratorv=(Vibrator)getSystemService(Context.VIBRATOR_SERVICE);v.vibrate(getResources().getInteger(R.integer.vibration_duration));应该在2秒(2000毫秒)后停止。这在屏幕打开时效果很好,但如果屏幕关闭,振动将继续,直到屏幕被触摸并唤醒。编辑:我确实整理了一个快速hack以使其与计时器一起工作,但我希望能够以更干净的方式停止振动。finalVibratorv=(Vibrator)getSystemSer

android - 浓缩咖啡 :No views in hierarchy found matching with id: android:id/home

当我运行我的测试用例时,我遇到了异常。android.support.test.espresso.NoMatchingViewException:Noviewsinhierarchyfoundmatching:withid:android:id/home这是我的测试用例代码。publicvoidnav_to_alarm_test(){onView(withId(R.id.navigation_notifications)).perform(click());onView(withId(R.id.rl_reminder)).perform(click());onView(withId(R

android.view.AbsSavedState$1 无法转换为 android.widget.CompoundButton$SavedState

我在Crashlytics上经常看到以下错误:Causedbyjava.lang.ClassCastException:android.view.AbsSavedState$1cannotbecasttoandroid.widget.CompoundButton$SavedStateatandroid.widget.CompoundButton.onRestoreInstanceState(CompoundButton.java)atandroid.view.View.dispatchRestoreInstanceState(View.java)atandroid.view.ViewG

javascript - meteor :即使设置了 ANDROID_HOME 也没有设置

操作系统:Ubuntu14.04框架:meteor1.1.0.2应用名称:Songofy这是meteorinstall-sdkandroid的输出meteorinstall-sdkandroid✓FoundAndroidbundle✓AJDKisinstalled✓FoundAndroidPlatformtools✓FoundAndroidBuildTools✓FoundAndroid19API✓FoundsuitableAndroidx86image✓'meteor'androidvirtualdevice(AVD)found✗Androidemulatoraccelerationi

android - 错误:com. android.dex.DexException: Multiple dex files define Landroid/support/design/widget/CoordinatorLayout$HierarchyChangeListener

我已经尝试过这些解决方案-Solution1,Solution2这是我的gradle依赖项。dependencies{implementationfileTree(include:['*.jar'],dir:'libs')//noinspectionGradleCompatibleimplementation'com.android.support:appcompat-v7:27.0.2'implementation'com.android.support.constraint:constraint-layout:1.0.2'implementation'com.android.sup

android - App Widget 上的 Marquee TextView

我正在开发一个AppWidget,我需要一个TextView来将文本显示为选取框。我已尝试使用以下代码(就像在常规Activity中所做的那样),但文本不会滚动。谁能告诉我如何解决这个问题? 最佳答案 您需要在xml中为选取框添加以下属性:android:singleLine="true"android:ellipsize="marquee"android:marqueeRepeatLimit="marquee_forever"android:scrollHorizontally="true"android:focusable="t

android.widget.RelativeLayout 无法转换为 android.support.v7.widget.RecyclerView

我的NavigationDrawer布局有问题,有错误:android.widget.RelativeLayoutcannotbecasttoandroid.support.v7.widget.RecyclerView这是我的onCreateView:@OverridepublicViewonCreateView(LayoutInflaterinflater,ViewGroupcontainer,BundlesavedInstanceState){mRecyclerView=(RecyclerView)inflater.inflate(R.layout.fragment_drawer,

javascript - 使用 React Navigators 嵌套导航器 - 'Home' 应该声明一个屏幕

我目前正在使用ReactNative和新的ReactNavigation。我正在尝试关注tutorialfornestingnavigators,但总是报错:Route'Home'shoulddeclareascreen.Forexample:importMyScreenfrom'./MyScreen';...Home:{screen:MyScreen,}我不确定我做错了什么。当我单独启动导航器时,它们会工作。但不幸的是没有合并。这是我使用教程创建的App.js:importReactfrom'react';import{AppRegistry,Text,View,Button}fro

java - 循环遍历 Activity 中的所有 "widgets"/元素

几天前我启动了自己的Android应用程序,因为我需要一个移动应用程序来存储我在医院收集的大量数据。我是Java和android环境的新手,虽然它看起来很容易理解并且与C++非常相似。无论如何,我的应用程序有一堆“EditText”和单选按钮,我的问题是:我如何遍历所有这些小部件(EditTexts和单选按钮)?在.NET中,您可以执行“为容器中的每个元素”循环,但我似乎无法在Java/android环境中找到执行此操作的方法。注意:我不知道Activity中有多少“小部件”,因为有些是动态创建的,有些是硬编码的,有些则显示是否设置了某些用户首选项如有任何帮助或提示,我们将不胜感激。