小编Dom*_*000的帖子

Android,谷歌地图片段和viewpager - 错误膨胀类片段

我试图在一个片段中的viewpager(fragmentpager)中使用google maps v2.如果我滑到第四个片段(查看寻呼机),它工作正常,但如果我回到第一个片段,然后回到第四个 - 与地图 - 我的应用程序死了.

07-04 19:38:20.937: E/AndroidRuntime(20175): FATAL EXCEPTION: main
07-04 19:38:20.937: E/AndroidRuntime(20175): android.view.InflateException: Binary XML     
file line #13: Error inflating class fragment
...
07-04 19:38:20.937: E/AndroidRuntime(20175): Caused by:     
java.lang.IllegalArgumentException: Binary XML file line #13: Duplicate id 0x7f050010,
 tag null, or parent id 0x0 with another fragment for  com.google.android.gms.maps.SupportMapFragment

07-04 19:38:20.937: E/AndroidRuntime(20175):    at     android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:285)
07-04 19:38:20.937: E/AndroidRuntime(20175):    at     android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:676)
Run Code Online (Sandbox Code Playgroud)

Android Java:

public class LocationDetail extends Fragment {

private SupportMapFragment mMapFragment;
private GoogleMap map;
private EventAdapter listAdapter ; …
Run Code Online (Sandbox Code Playgroud)

android google-maps android-fragments

13
推荐指数
1
解决办法
3566
查看次数

test-path返回权限被拒绝 - 如何进行错误处理

我尝试在我的powershell脚本中进行错误处理.但我总是致命的.我尝试了一些东西,比如试试{} catch {} - 但我没有开始工作.

任何想法或解决方案?

Function Check-Path($Db)
{
    If ((Test-Path $Db) –eq $false) {
        Write-Output "The file $Db does not   exist"
        break
    }
}
Run Code Online (Sandbox Code Playgroud)

它返回:

Test-Path : Zugriff verweigert
In K:\access\access.ps1:15 Zeichen:6
+ If ((Test-Path $Db) -eq $false) {
+      ~~~~~~~~~~~~~
    + CategoryInfo          : PermissionDenied: (K:\ss.mdb:String) [Test-Path],     UnauthorizedAccessException
+ FullyQualifiedErrorId : ItemExistsUnauthorizedAccessError,Microsoft.PowerShell.Commands.TestPathCommand
Run Code Online (Sandbox Code Playgroud)

powershell exception-handling

3
推荐指数
1
解决办法
6182
查看次数