草庐IT

ACTION_INTENT

全部标签

android - Intent 在android中拍摄视频

我需要仅使用前置摄像头从我的应用程序中拍摄视频。我正在使用Intent执行此操作。Intentintent=newIntent(MediaStore.ACTION_VIDEO_CAPTURE);intent.putExtra(MediaStore.EXTRA_OUTPUT,videoUri);intent.putExtra("android.intent.extra.durationLimit",30);intent.putExtra("android.intent.extras.CAMERA_FACING",1);//toopenfrontfacingcamerastartActiv

android - 在 manifest.xml 中声明的 BroadcatReceiver 未接收到 LocalBroadcastManager Intent

虽然可以通过代码声明“本地”BroadcastReceiver,以便它接收通过LocalBroadcastManager.Ex发布的IntentLocalBroadcastManager.getInstance(this).registerReceiver(newFooReceiver(),newIntentFilter("foo_intent_filter"));我想知道是否可以通过ma​​nifest.xml(cleaner)声明这样的接收器。当我使用“list方式”时,接收方未“接收”Intent。我错过了什么吗?或者代码方式是唯一可行的解​​决方案。谢谢

android - 如何对从 Activity 启动/发送的 Intent 进行单元测试?

我如何创建AndroidJUnit测试用例来测试Activity中生成的Intent的内容?我有一个包含EditText窗口的Activity,当用户完成输入所需数据时,Activity会启动一个Intent到IntentService,后者记录数据并继续应用程序进程。这是我要测试的类,OnEditorActionListener/PasscodeEditorListener是作为单独的类创建的:publicclassPasscodeActivityextendsBaseActivity{EditTextm_textEntry=null;PasscodeEditorListenerm_

android - Google Play 音乐是否占用了所有 ACTION_MEDIA_BUTTON Intent ?

当发送带有ACTION_MEDIA_BUTTONIntent的sendOrderedBroadcast时(我模拟用户正在点击蓝牙耳机上的播放按钮),GooglePlay音乐会打开并播放上次播放的专辑,而不是前台音乐播放应用。如果我将其更改为sendBroadcast,GooglePlay音乐和当前的音乐播放应用程序(在我的例子中是Pandora)都会启用播放按钮。这只发生在Android4.0及以上。PlayMusic是否占用了这个Intent(错误)?您是否怀疑Pandora没有按照以下建议将自己注册为当前的媒体按钮处理程序:http://android-developers.blo

android - React-Native Android - 从 Intent 中获取变量

我正在使用intent来启动我的React-Native应用程序,并且我正在尝试找出如何获取我在native代码中放置在intent上的变量。这可能来自react-native还是我必须编写一些java代码才能获得它?我用来启动应用程序的代码:Intentintent=newIntent(this,MainActivity.class);Intent.putExtra("alarm",true);intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);startActivity(intent);谢谢! 最佳答案

android - 如何检测 Android 服务中的 MotionEvent.ACTION_DOWN

我正在运行后台服务来检测Android5.0中的MotionEvent.ACTION_DOWN。我使用了下面的代码,它可以检测到我的触摸事件,但我无法触摸其他应用程序。我该如何解决?如果你有更好的解决方案,请给我。谢谢大家。publicclassTouchServiceListenerextendsServiceimplementsOnTouchListener{privateWindowManagermWindowManager;//linearlayoutwillusetodetecttoucheventprivateLinearLayouttouchLayout;@Overrid

android - android 2.3平台如何添加Action bar?

在我的应用程序中,我想创建一个操作栏作为我的应用程序图标和一个View控件。我引用了很多教程和示例来创建操作栏,但它们都有大量代码。我还阅读了ActionBarSherlock但这需要minsdkversion15来编译库。因为我是android新手,所以我需要一步一步的教程来创建一个简单的操作栏。如果您知道使用xml创建操作栏的简单教程,请发布您的答案。 最佳答案 我已经使用这个库为2.2+应用程序添加了操作栏:https://github.com/johannilsson/android-actionbar我发现它易于使用且视觉

android - 在 Xamarin Mono for Android 中使用 Intent 过滤器处理特定 URL

我正在尝试让我的Activity句柄url以mydomain.com或www.mydomain.com的形式与http和https方案。目前,我的Activity的IntentFilter属性如下所示:[IntentFilter(new[]{Intent.ActionView},Categories=new[]{Intent.CategoryDefault,Intent.CategoryBrowsable},DataHost="mydomain.com",DataScheme="http")]它在list中生成这个,并且似乎不适用于任何所需的url配置:如何更改此属性,以便我的Acti

ios - 关闭 Cupertino 对话 Action Flutter

在使用解释的方法关闭呈现的Cupertino警报对话操作时,我的整个屏幕都会弹出,并且警报对话会留在屏幕上。这是我的代码。if(deviceList.isEmpty){varalert=newCupertinoAlertDialog(title:newText("Alert"),content:newText("Therewasanerrorsigningin.Pleasetryagain."),actions:[newCupertinoDialogAction(child:constText('Discard'),isDestructiveAction:true,onPressed:

ios - 关闭 Cupertino 对话 Action Flutter

在使用解释的方法关闭呈现的Cupertino警报对话操作时,我的整个屏幕都会弹出,并且警报对话会留在屏幕上。这是我的代码。if(deviceList.isEmpty){varalert=newCupertinoAlertDialog(title:newText("Alert"),content:newText("Therewasanerrorsigningin.Pleasetryagain."),actions:[newCupertinoDialogAction(child:constText('Discard'),isDestructiveAction:true,onPressed: