【Android开发那点破事】打开APP加载页面实现
今天的破事呢就说说APP加载页面的实现。一般情况下,当APP打开的时候,我们需要做很多事情,比如检查网络连接啊,初始化一些配置啊等等。我们可以让这些事情在APP完全打开之前做完,然后呢在打开的过程中显示一些logo信息。想必大家都见过。
先贴个运行效果:
好,我们进入正题。
首先我们先配置下AndroidManifest.xml
在application节点里面添加一个自定义的activity:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".LaunchActivity" android:gravity="center" android:background="#FFFFFF" > <ImageView android:id="@+id/launch_logo" android:layout_width="wrap_content" android:layout_height="wrap_content" android:contentDescription="@string/empty" android:src="@drawable/launch_logo" android:scaleType="fitXY" android:gravity="center" android:layout_gravity="center" /> </FrameLayout>
好了今天这个破事就到这里,其实android开发就这么点破事。关于其他破事,见专栏:
更多Android开发的破事,请看专栏:《Android开发那点破事》