0
我不得不採取一個可以稍後保存在SD卡中的屏幕截圖。我已經通過下面這個鏈接給出的代碼。截圖,但在android中顯示0 KB文件?
Android take screenshot via code
的問題是,它會在我的SD卡零(0)KB文件。可能是什麼問題呢?什麼是id.layoutroot
?
我不得不採取一個可以稍後保存在SD卡中的屏幕截圖。我已經通過下面這個鏈接給出的代碼。截圖,但在android中顯示0 KB文件?
Android take screenshot via code
的問題是,它會在我的SD卡零(0)KB文件。可能是什麼問題呢?什麼是id.layoutroot
?
layoutroot是最有可能給根佈局ID爲
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layoutroot"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
...
... (other ui items)
嘗試使用你想捕捉並檢查是否啓用圖紙緩存視圖的ID。