检查片段中的savedInstanceState状态

时间:2018-05-18 11:48:10

标签: android fragment android-savedstate

为什么我们不检查Severity Code Description Project File Line Suppression State Error Package FM.IceLink.WebRTC 2.9.32 is not compatible with monoandroid81 (MonoAndroid,Version=v8.1). Package FM.IceLink.WebRTC 2.9.32 supports: - net35 (.NETFramework,Version=v3.5) - net40 (.NETFramework,Version=v4.0) - net45 (.NETFramework,Version=v4.5) - wp8 (WindowsPhone,Version=v8.0) 0 Error Package FM.IceLink 2.2.0 is not compatible with monoandroid81 (MonoAndroid,Version=v8.1). Package FM.IceLink 2.2.0 supports: - net35 (.NETFramework,Version=v3.5) - net40 (.NETFramework,Version=v4.0) - net45 (.NETFramework,Version=v4.5) - win8 (Windows,Version=v8.0) - wp8 (WindowsPhone,Version=v8.0) 0 Error Package restore failed. Rolling back package changes for 'videochattest'. 0 Error Package FM 2.0.0.5 is not compatible with monoandroid81 (MonoAndroid,Version=v8.1). Package FM 2.0.0.5 supports: net40 (.NETFramework,Version=v4.0) 0 片段回调中的Severity Code Description Project File Line Suppression State Error Could not install package 'FM 2.0.0.5'. You are trying to install this package into a project that targets 'MonoAndroid,Version=v7.1', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author. 而不是savedInstanceState(推荐)? 根据片段生命周期中onCreateView回调之后调用的片段onActivityCreated的生命周期。

1 个答案:

答案 0 :(得分:0)

如果您仔细阅读本文,则可以清楚地解释您可以在onSaveInstanceState之前的任何时间致电onDestroy。因此,要回答您的问题,您也可以使用onCreateView方法调用该方法。

Google Developer Link - Fragment onSaveInstanceState