我有一个arraylist存储从Firebase存储下载的所有Uri。
我将此列表传递给我的CustomAdapter,以便在ViewPager中显示所有图像,但由于以下错误而无法执行此操作:
BitmapFactory:无法解码流:java.io.FileNotFoundException:
MainActivity:
@Override
public Object instantiateItem(ViewGroup container, int position) {
inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View v = inflater.inflate(R.layout.swipe,container,false);
ImageView img = (ImageView) v.findViewById(R.id.imageView);
Bitmap bitmap = BitmapFactory.decodeFile(list.get(position).getPath());
img.setImageBitmap(bitmap);
container.addView(v);
return v;
}
CustomAdapter:
function Start-Exe
{
param
( [string]$exePath, [string]$args1 )
$returnVal = $false
$pinfo = New-Object System.Diagnostics.ProcessStartInfo
$pinfo.FileName = $exePath
$pinfo.RedirectStandardError = $true
$pinfo.RedirectStandardOutput = $true
$pinfo.UseShellExecute = $false
$pinfo.Arguments = $args1
$p = New-Object System.Diagnostics.Process
$p.StartInfo = $pinfo
$p.Start() | Out-Null
$p.WaitForExit()
$stdout = $p.StandardOutput.ReadToEnd()
$stderr = $p.StandardError.ReadToEnd()
$exitCode = $p.ExitCode
#OutputFile can be some log file, or just use write-host to pump to console
#$stdout | Add-Content $global:OutputFile
#$stderr | Add-Content $global:OutputFile
return $exitCode
}