我使用AlarmManager在午夜激活一个Intent,它会加载一个ArrayList并对其项目进行一些修改。问题是,我有一个Fragment,它在onPause()中保存了ArrayList的版本。我想要的是, 当警报意图关闭时,片段从SharedPreferences重新加载ArrayList,并且还更新视图。 换句话说,我想重新加载片段而不显示应用程序的关闭/重启。
任何人都可以告诉我如何从我的Receiver课程中做到这一点吗?
$helpContent = $functionDefinitions | ForEach-Object {
# Get the plain string comment block from the AST.
$commentBlock = $_.GetHelpContent().GetCommentBlock()
# Create a scriptblock that defines a blank version of the
# function with the CBH. You may lose some parameter info
# here, if you need that replace param() with
# $_.Body.ParamBlock.Extent.Text
$scriptBlock = [scriptblock]::Create(('
function {0} {{
{1}
param()
}}' -f $_.Name, $commentBlock))
# Dot source the scriptblock in a different scope so we can
# get the help content but still not pollute the session.
& {
. $scriptBlock
Get-Help $_.Name
}
}
}