首页 » 2019年6月

一般情况下,打文件都在/home/username/下,经过我发现:/home/shenfeng/.local/share 这个文件夹比较大。这个文件一般是一些用户数据,比如邮件。还有回收箱数据 ~/.local/share/Trash

检测隐藏文件方法

du -sh .[!.]*

检测常规文件大小

du -sh *

删除

rm -rf ~/.local/share/

最近使用archlinux 报磁盘不足,还好我有一个打磁盘,不是ssd,也可以用了
sudo -i
fdisk -l #查看所有的磁盘
mkfs.ext4 /dev/sdb4 #如果需要格式化,就运行这个
mount -w /dev/sdb4 /home/shenfeng/myfile #挂载
sudo chmod 777 /home/shenfeng/myfile #更改权限

设置开机挂载,vim /etc/fstab

/dev/sdb4    /home/shenfeng/myfile    ext4    defaults    0    1

安卓开发使用androidx 的circleimage 报错: Caused by: java.lang.NoSuchMethodException: androidx.swiperefreshlayout.widget.CircleImageView.

原因是这个类是私有的,只好使用 ,de.hdodenhof:circleimageview
1.加入依赖

api 'de.hdodenhof:circleimageview:2.2.0'

2.使用

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
android:id="@+id/parent_layout">
    <de.hdodenhof.circleimageview.CircleImageView
            android:layout_width="80dp"
            android:layout_height="80dp"
            android:id="@+id/image"
            android:src="@mipmap/ic_launcher" />
    <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Canada"
            android:id="@+id/image_name"
            android:layout_toRightOf="@+id/image"
            android:textColor="#000"
            android:layout_centerVertical="true"
            android:layout_marginLeft="30dp"
            android:textSize="17sp"/>
</RelativeLayout>

完整报错

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.greenhtml.demo, PID: 5645
    android.view.InflateException: Binary XML file line #6 in com.greenhtml.demo:layout/layout_listitem: Binary XML file line #6 in com.greenhtml.demo:layout/layout_listitem: Error inflating class androidx.swiperefreshlayout.widget.CircleImageView
    Caused by: android.view.InflateException: Binary XML file line #6 in com.greenhtml.demo:layout/layout_listitem: Error inflating class androidx.swiperefreshlayout.widget.CircleImageView
    Caused by: java.lang.NoSuchMethodException: androidx.swiperefreshlayout.widget.CircleImageView.<init> [class android.content.Context, interface android.util.AttributeSet]
        at java.lang.Class.getConstructor0(Class.java:2332)
        at java.lang.Class.getConstructor(Class.java:1728)
        at android.view.LayoutInflater.createView(LayoutInflater.java:824)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1006)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:961)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:1123)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:682)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:534)
        at com.greenhtml.demo.adapters.RecyclerAdapter.onCreateViewHolder(RecyclerAdapter.kt:50)
        at com.greenhtml.demo.adapters.RecyclerAdapter.onCreateViewHolder(RecyclerAdapter.kt:20)
        at androidx.recyclerview.widget.RecyclerView$Adapter.createViewHolder(RecyclerView.java:6992)
        at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:6161)
        at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:6044)
        at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:6040)
        at androidx.recyclerview.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2303)
        at androidx.recyclerview.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1627)
        at androidx.recyclerview.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1587)
        at androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:665)
        at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:4063)
        at androidx.recyclerview.widget.RecyclerView.dispatchLayout(RecyclerView.java:3780)
        at androidx.recyclerview.widget.RecyclerView.onLayout(RecyclerView.java:4333)
        at android.view.View.layout(View.java:21892)
        at android.view.ViewGroup.layout(ViewGroup.java:6260)
        at androidx.coordinatorlayout.widget.CoordinatorLayout.layoutChild(CoordinatorLayout.java:1193)
        at androidx.coordinatorlayout.widget.CoordinatorLayout.onLayoutChild(CoordinatorLayout.java:880)
        at androidx.coordinatorlayout.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:899)
        at android.view.View.layout(View.java:21892)
        at android.view.ViewGroup.layout(ViewGroup.java:6260)
        at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
        at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
        at android.view.View.layout(View.java:21892)
        at android.view.ViewGroup.layout(ViewGroup.java:6260)
        at androidx.appcompat.widget.ActionBarOverlayLayout.onLayout(ActionBarOverlayLayout.java:446)
        at android.view.View.layout(View.java:21892)
        at android.view.ViewGroup.layout(ViewGroup.java:6260)
        at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
        at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
        at android.view.View.layout(View.java:21892)
        at android.view.ViewGroup.layout(ViewGroup.java:6260)
        at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1829)
        at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1673)
        at android.widget.LinearLayout.onLayout(LinearLayout.java:1582)
        at android.view.View.layout(View.java:21892)
        at android.view.ViewGroup.layout(ViewGroup.java:6260)
        at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
        at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
        at com.android.internal.policy.DecorView.onLayout(DecorView.java:773)
        at android.view.View.layout(View.java:21892)
        at android.view.ViewGroup.layout(ViewGroup.java:6260)
        at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:3078)
        at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2588)
        at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1721)
        at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7595)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:966)
        at android.view.Choreographer.doCallbacks(Choreographer.java:790)
        at android.view.Choreographer.doFrame(Choreographer.java:725)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:951)
        at android.os.Handler.handleCallback(Handler.java:883)
        at android.os.Handler.dispatchMessage(Handler.java:100)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7319)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:934)