草庐IT

current_direction

全部标签

android - 无法使用错误 : There's another emulator instance running with the current AVD 启动 android 模拟器

使用CLI并使用以下命令运行模拟器:./emulator-use-system-libs@Nexus5API25只显示错误,模拟器不启动。emulator:ERROR:There'sanotheremulatorinstancerunningwiththecurrentAVD'Nexus5API25'.Exiting...还有:没有任何正在运行的模拟器实例。Nexus5API25确实存在并且过去一直在工作。我必须在我的机器上使用-use-system-libs标志来启动模拟器实例。其他AVD正在运行。当使用-verbose执行时,会打印更多详细信息,但我没有看到任何可以帮助我解决问题的

android - 在创建 android 通知时,在 PendingIntent 中使用 FLAG_UPDATE_CURRENT 时会重复 Intent 额外内容

我想创建多个通知来启动(或刷新)Activity以显示产品描述。Notificationnotification=newNotification(R.drawable.applicationicon,Resources.getString("NewSaleNotification",context),System.currentTimeMillis());//Hidethenotificationafteritsselectednotification.flags|=Notification.FLAG_AUTO_CANCEL;Intentintent=newIntent(context

android - ionic 2/ ionic 3 : How to get current location of a device

stackoverflow上的所有答案都不适合我。其中很多是针对Ionic1的,或者这些答案已被弃用,或者它们不适用于Android设备。我在stackoverflow上看到了很多关于获取设备当前位置的解决方案,但似乎没有一个适用于Android。我尝试过的:-使用geolocation.getCurrentPosition(),适用于IOS和browser但不适用于Android.使用this.geolocation.watchPosition(),适用于IOS和browser但不适用于Android。使用navigator.geolocation.getCurrentPositio

Android Wifi Direct : Avoiding user acceptance when connecting to a known peer

使用WiFiDirect连接到对等点时,需要用户许可。我知道如果没有用户从未给予许可,就无法建立连接,并且对这种功能有一个功能请求:https://code.google.com/p/android/issues/detail?id=30880但我不需要这个功能,在第一次连接时请求许可就可以(也更安全)。是否有任何方法可以仅在第一次请求许可?并且稍后尝试连接到同一个对等方时,不需要权限。 最佳答案 从P2P规范中,我们可以找到一种叫做“持久P2P组”的东西,它旨在在没有用户干预的情况下重新建立一个组。在持久P2P组中,组所有者存储组

android - 设置适配器 "Call requires API level 11 (current min is 8): android.widget.AbsListView#setAdapter"?

我正在调用setAdapter()扩展Fragment的类中的方法.注意我已经导入了android.support.v4.app.Fragment.但我收到一条错误消息,指出API级别必须为11级。我必须做些什么才能在不更改minSdkVersion="8"的情况下解决此问题至minSdkVersion="11"packagefoo.bar.qux;importjava.util.Calendar;importjava.util.Date;importorg.w3c.dom.Document;importorg.w3c.dom.NodeList;importandroid.suppor

android - 我怎样才能避免 "IllegalStateException: Scrollview can host only one direct child"?

我在我的Android布局中使用ScrollView但它显示IllegalStateException"Scrollview只能承载一个直接子级"如何避免此异常?崩溃信息:07-1915:58:22.3082137221372DAndroidRuntime:ShuttingdownVM07-1915:58:22.3132137221372EAndroidRuntime:FATALEXCEPTION:main07-1915:58:22.3132137221372EAndroidRuntime:Process:com.languoguang.helloworld,PID:2137207-1

android - WiFi Direct (Android 4.0) 与多个 (3+) 设备

喜欢这里:AutomaticauthenticationforAndroidWiFiDirect我想用Android设备创建一个移动ad-hocWifi网络。但与上面的链接问题不同,我想使用自Android4.0以来可用的官方AndroidWiFiDirectAPI。那么有没有一种方法不仅可以通过WiFiDirect连接2个设备,还可以连接三个或更多设备?那么消息可以使用中间的几个其他设备从一个设备传递到另一个设备(因此在发送者和接收者之间跨越更大的距离)?WifiDirectdemo仅适用于配对两个设备,我找不到其他方法。谢谢! 最佳答案

安卓 : Change entire app layout directions programmatically

如何将整个应用布局方向更改为RTL?我正在编写一个应用程序,用户必须在首次启动时选择它的语言,并且布局应该根据用户选择更改为RTL或保持LTR。我曾经为每个布局添加android:supportsRtl="true"到AndroidManifest和android:layoutDirection="rtl"但这种方法有一些问题如下:一个问题是,当我将方向更改为RTL时,ActionBar主页图标或导航按钮(启用主页时)仍然是LRT,只是向右移动。我也尝试以编程方式改变方向,结果是一样的:if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.JELL

android - 模拟器 : emulator: ERROR: x86 emulation currently requires hardware acceleration! 模拟器:进程以退出代码 1 完成

Emulator:emulator:ERROR:x86emulationcurrentlyrequireshardwareacceleration!Emulator:Processfinishedwithexitcode1 最佳答案 我遇到了完全相同的问题。这就是我修复它的方式(对于Windows):进入AndroidStudio并打开SDK管理器(在工具菜单下)在SDK平台选项卡下,取消选中任何选中的框。如果选中任何框,则表示它们已安装-但我们现在想卸载它们。转到SDK工具选项卡。确保选中AndroidEmulator、Andro

android - FragmentStatePagerAdapter IllegalStateException : <MyFragment> is not currently in the FragmentManager

在onResume()的某些情况下,我在使用FragmentStatePagerAdapter的Activity中得到了这个。使用设备的后退按钮时。不总是。不可重现。我正在使用支持包v4,最新版本(8)。已经用谷歌搜索过,没有找到有用的答案。查看源码,这里抛出的是:FragmentManager.java@OverridepublicvoidputFragment(Bundlebundle,Stringkey,Fragmentfragment){if(fragment.mIndex但是为什么fragment的索引实例化fragment的代码:@OverridepublicFragmen