android的ListView

我退出当前activity退出后,ListView界面的内容被清空了,怎么办

从OnCreate里重新加载数据

  • 你可以参考下这个问题的回答, 看看是否对你有帮助, 链接: https://ask.csdn.net/questions/296
  • 我还给你找了一篇非常好的博客,你可以看看是否有帮助,链接:Android动画、补间,帧,Activity跳转,ListView条目 , 属性动画
  • 除此之外, 这篇博客: Android最常用的控件ListView(详解)中的     1.布局界面 activity_main.xml 代码: 部分也许能够解决你的问题, 你可以仔细阅读以下内容或跳转源博客中阅读:
  • <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
         xmlns:app="http://schemas.android.com/apk/res-auto"
         xmlns:tools="http://schemas.android.com/tools"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         tools:context=".MainActivity">
         <ListView
             android:id="@+id/list_view"
             android:layout_width="match_parent"
             android:layout_height="match_parent"/>
    </LinearLayout>
    

数据读取操作需要在onresume的时候执行一次