草庐IT

transit-time

全部标签

android - java.net.SocketException : recvfrom failed: ECONNRESET (Connection reset by peer) is occuring some times 异常

我已经为这个很少发生的异常搜索了很多,但是我没有找到任何可以解决我的问题的相关答案,我正在使用HttpURLConnection从url获取响应作为xml,它工作正常但有时我会收到此异常:java.net.SocketException:recvfromfailed:ECONNRESET(Connectionresetbypeer),我使用了以下代码,url1是我的url,它提供了一个xml。url=newURL(url1);urlConnection=(HttpURLConnection)url.openConnection();urlConnection.setDoInput(tr

android - react 导航 : StackNavigator transition for Android

我正在使用这个库https://reactnavigation.org/docs/intro/通过react-native构建android。我可以让导航发生在android设备上,但我如何让屏幕从右侧滑入并从左侧淡入。似乎这种行为发生在iOS设备上,但不会发生在Android设备上。android应用程序是否有任何动画配置?请看下面的动画。这是在iOS中记录的。 最佳答案 开始于:“@react-navigation/native”:“^5.5.1”,import{createStackNavigator,TransitionPr

android - TransitionDrawable : automatically reverse transition once it completes

我想突出显示新添加的ListView项目,效果很好。我认为这很简单,但我偶然发现了一个问题:我想播放TransitionDrawable动画,一旦它完成-倒带。新项目将高亮显示片刻,然后与其余项目融合。TransitionDrawable有向前和向后播放动画的方法,但没有可用于同步的方法。我希望有可能为动画完成指定回调,例如:TransitionDrawabletransition=(TransitionDrawable)view.getBackground();transition.startTransition(500,newTransitionCompleteListener()

android - 无法让 Joda-time 在 Android 上运行。

我正在学习Android并且需要日期/时间。一位同事向我推荐了Joda-time,这似乎正是我取得进步所需要的。不幸的是,我无法让它正常工作。我正在使用intellij,这是Android2.2。我采取的步骤:从website下载Joda-timejar.Intellij>文件>项目结构>附加类build然后我得到这个错误:warning:IgnoringInnerClassesattributeforananonymousinnerclassthatdoesn'tcomewithanassociatedEnclosingMethodattribute.(Thisclasswaspro

android - 无法完成 session : INSTALL_FAILED_INVALID_APK: Split lib_slice_0_apk was defined multiple times

我正在尝试使用约束布局。Gradle构建成功完成。但是我得到了“安装APK时出错”,代码如下:Failedtofinalizesession:INSTALL_FAILED_INVALID_APK:Splitlib_slice_0_apkwasdefinedmultipletimes这是我的布局代码:我首先在sub中得到一个关于“Viewconstraint”的错误代码我通过使用推断约束修复了它。我是Android布局的新手,我正在尝试使用ConstraintLayout制作响应式布局。请帮我解决这个问题。 最佳答案 您可以通过重建项

android - AudioTrack 延迟 : obtainBuffer timed out

我通过FileInputStream>BufferedInputStream>DataInputStream方法加载文件并将字节送入AudioTrack.write()来在我的Android手机上播放WAV。音频播放良好,当它播放时,我可以轻松地动态调整采样率、音量等,性能也不错。但是,轨道开始播放大约需要两秒。我知道AudioTrack有不可避免的延迟,但这是荒谬的。每次我播放轨道时,我都会得到这个:03-1314:55:57.100:WARN/AudioTrack(3454):obtainBuffertimedout(istheCPUpegged?)0x2e9348user=000

android.text.format.Time 替换需要,因为它已被弃用

我是android的新手,我有需要使用Time对象的代码。谁能帮助我在不使用Time类的情况下实现相同的功能。TimedayTime=newTime();dayTime.setToNow();//westartatthedayreturnedbylocaltime.Otherwisethisisamess.intjulianStartDay=Time.getJulianDay(System.currentTimeMillis(),dayTime.gmtoff);//nowweworkexclusivelyinUTCdayTime=newTime();longdateTime;//Che

android - Android : The datetime zone id 'America/New_York' is not recognised 中的 Joda-Time 错误

异常(exception):Causedby:java.lang.IllegalArgumentException:Thedatetimezoneid'America/New_York'isnotrecognised安卓代码:DateTimedt=newDateTime();DateTimeZonedtZone=DateTimeZone.forID("America/New_York");DateTimedtus=dt.withZone(dtZone);DatedateInUS=dtus.toDate();System.out.println(dateInUS);为什么会出现此错误?我

android - 是否可以通过Google Places API获取 "Popular times"信息

是否可以通过GooglePlacesAPI或任何其他API获取“热门时间”信息?我需要将此信息显示在我的特定位置的应用程序中。 最佳答案 这是Google问题跟踪器中最重要的功能请求之一(超过500颗星):https://issuetracker.google.com/issues/35827350目前,状态为Assigned,但Google未提供任何ETA。请加注星标以获得进一步的更新。 关于android-是否可以通过GooglePlacesAPI获取"Populartimes"信息

android fragment addToBackStack(null) :how to add the same fragment to stack just one time?

当fragment使用addToBackStack(null)方法在一个activity中多次点击某个方法时,fragment页面每次都会保存到backstack中,当我按返回键时,它会恢复到相同的页面,如何添加相同的fragment只堆叠一次?mSettingBtn.setOnClickListener(newOnClickListener(){@OverridepublicvoidonClick(Viewv){SettingFragmentsettingFragment=newSettingFragment();FragmentTransactiontransaction=getF