草庐IT

hello_button

全部标签

Android 模拟/发送 ACTION_MEDIA_BUTTON Intent

我正在尝试通过模拟耳机音乐控件来控制通用音乐播放(播放/暂停、跳过等)。有没有办法广播ACTION_MEDIA_BUTTONIntent?我用sendBroadcast()尝试了常规方法,但没有用。这可能吗? 最佳答案 试试这个longeventtime=SystemClock.uptimeMillis();IntentdownIntent=newIntent(Intent.ACTION_MEDIA_BUTTON,null);KeyEventdownEvent=newKeyEvent(eventtime,eventtime,KeyE

Android支持库23.2.0设置样式报错="@style/Widget.AppCompat.Button.Colored"

我正在使用所有最新的工具和gradle版本来实现我的应用程序。以前,一切正常,但现在彩色按钮样式在低于Lollipop的版本中导致错误。我正在使用的父主题-Theme.AppCompat.Light.NoActionBar和主题中定义的颜色-"colorPrimary","colorPrimaryDark","colorAccent","colorButtonNormal",colorControlNormal","colorControlActivated","colorControlHighlight"这是按钮View--line:114这是kitkat4.4.4中的崩溃-Caus

android - 如何在 Xamarin.Android 中保持 Button.Pressed 状态?

我是Xamarin.Android的新手,遇到了一些小问题。我想在点击后在按钮中保持按下状态,这就是我的代码:firstSelectButton.Click+=FirstSelectButton_Click;privatevoidFirstSelectButton_Click(objectsender,EventArgse){firstSelectButton.Pressed=true;secondSelectButton.Pressed=false}但它不起作用。我知道原生Android中的setPressed属性,但在Xamarin中找不到相同的属性。

android - 使用 Android,如何从包含 Button 控件的 ListView 中选择行

我有以下使用ListView的非常简单的测试程序。我创建了一个ListView并将其设置为内容View。我设置了一个提供行的ListAdapter。一共有30行,每一行由一个LinearLayoutViewGroup组成。在那个ViewGroup中,我放置了一个TextView和一个Button。当我运行该程序时,我发现我无法选择列表中的行。但是,我可以滚动列表并单击按钮。如果我从LinearLayout中删除按钮(这样它只包含TextView),那么我就可以选择列表的行。我会喜欢能够在我的个人行View上有按钮,并且仍然能够选择列表的行。在另一个论坛上,有人说这是可能的,但我不知道如

c# - 我正在尝试使单声道 android 简单 "hello world"但我在模拟器中看不到 "hello world"为什么?

我卸载了androidask并重新安装到没有空格的c:\androidSdktools。所以现在模拟器可以工作了,我可以看到模拟器了。但尝试了一些“helloworld”文本的代码,当我运行应用程序和运行模拟器时,我看到了android模拟器,但我看不到wnyhere“helloworld”。我不确定我是否没有做任何好事,或者可能是因为我在退出模拟器并停止调试时仍然遇到错误,我得到错误说:部署错误。如果我继续说"is",那么他会要求我在运行/调试之前重建/构建我的解决方案,但我确实这样做了,但它没有解决这个错误。我不知道这个错误是否与我在android模拟器中没有看到任何“hellow

Android Button边框阴影

ButtonView中的Shadow属性为文本提供阴影。如何给Button的右边框和底边框添加阴影?如下图: 最佳答案 你可以试试。我在我的项目中使用它。我给按钮的右边框和底边框添加了阴影。ButtonxmlIndrawablefileaddbutton_dropshadow.xml谢谢。 关于AndroidButton边框阴影,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/questions/10

java - 从 MainActivity 的 Button Click 中的 Fragment 访问方法

各位,我正在尝试通过在MainActivity中单击按钮向MapFragment(Fragment)发送用户当前的纬度和经度。我使用在MainActivity中实现的fragment的接口(interface),但是当我尝试从fragmentonButtonClick访问方法时,我得到一个atandroid.app.ActivityThread.main(ActivityThread.java:5221)            atjava.lang.reflect.Method.invoke(NativeMethod)            atjava.lang.reflect.M

android - 无法解析符号'android :TextAppearance. Material.Widget.Button.Inverse

我已经在androidstudio中创建了项目,但是出现了以下错误。错误:C:\Learning\Android\Design\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\23.1.1\res\values-v23\values-v23.xmlError:(1)Errorretrievingparentforitem:Noresourcefoundthatmatchesthegivenname'android:TextAppearance.Material.Widget.Button.Inv

android - Hello World 没有显示在 react native android 中

您好,我在react-native中为android制作了HelloWorld程序。我跟着这个https://facebook.github.io/react-native/docs/tutorial.html#content但它在启动应用程序时不会在屏幕上显示“HelloWorld”。它正在显示空白屏幕。我该如何解决这个问题。index.android.js/***SampleReactNativeApp*https://github.com/facebook/react-native*@flow*/importReact,{Component}from'react';import{

android - 日期/时间选择器 flutter : OK/CANCEL button not visible

flutter中的日期选择器小部件以白色显示确定/取消按钮,因此在白色背景中不可见。_displayFromDate=awaitshowDatePicker(context:context,initialDate:now,firstDate:now,lastDate:now.add(newDuration(days:30)),);我尝试将页面主题更改为黑色的主要强调色。还是看不出来。按钮在那里,因为我可以点击它们,只是标题不可见。[✓]Flutter(Channelmaster,v1.2.3-pre.67,onMacOSX10.13.617G5019,localeen-GB)[✓]An