{"id":424,"date":"2015-12-18T13:17:53","date_gmt":"2015-12-18T05:17:53","guid":{"rendered":"https:\/\/www.ray650128.com\/wordpress\/?p=424"},"modified":"2021-07-21T23:47:05","modified_gmt":"2021-07-21T15:47:05","slug":"androidapp%e5%95%9f%e5%8b%95%e7%95%ab%e9%9d%a2","status":"publish","type":"post","link":"https:\/\/blog.ray650128.com\/?p=424","title":{"rendered":"[Android]\u95dc\u65bcLaunch Screen\u7684\u5be6\u4f5c\u65b9\u5f0f"},"content":{"rendered":"\n<p>\u5e02\u9762\u4e0a\u4e0d\u5c11\u61c9\u7528\u7a0b\u5f0f\u90fd\u6709\u555f\u52d5\u756b\u9762\u3002<\/p>\n\n\n\n<p>\u7c21\u55ae\u4f86\u8aaa\uff0c\u555f\u52d5\u756b\u9762\u53ea\u662f\u4e00\u500b\u5168\u87a2\u5e55\u4e26\u986f\u793a\u81ea\u5df1Logo\u7684Activity\u3002<\/p>\n\n\n\n<p>\u51fa\u73fe\u4e00\u6bb5\u6642\u9593\u5c31\u81ea\u52d5\u8df3\u8f49\u5230\u61c9\u7528\u7a0b\u5f0f\u7684\u4e3b\u756b\u9762\uff0c\u56e0\u6b64\u5be6\u4f5c\u8d77\u4f86\u975e\u5e38\u5bb9\u6613\u3002<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>\u9996\u5148\u5efa\u7acb\u4e00\u500b\u7a7a\u767d\u7684Activity\uff0c\u4e26\u5728onCreate()\u7684callback\u52a0\u4e0a\u5ef6\u9072\u4e00\u6bb5\u6642\u9593\u7684intent\uff0c\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"java\" class=\"language-java line-numbers\">public class LaunchScreenActivity extends AppCompatActivity {\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_launch_screen);\n\n        Intent intent = new Intent(this, MainActivity.class);\n        Runnable runnable = new Runnable() {\n            @Override\n            public void run() {\n                startActivity(intent);\n                finish();\n            }\n        };\n        \n        new Handler().postDelayed(runnable, 500);\n    }\n}<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>\u63a5\u8457\u5728AndroidMainfest.xml\u4e2d\uff0c\u5c07\u555f\u52d5\u53c3\u6578\u6539\u6210LaunchScreen\uff0c\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">&lt;application\n    android:allowBackup=\"true\"\n    android:icon=\"@mipmap\/ic_launcher\"\n    android:label=\"@string\/app_name\"\n    android:roundIcon=\"@mipmap\/ic_launcher_round\"\n    android:supportsRtl=\"true\"\n    android:theme=\"@style\/Theme.MyApplication\">\n\n    &lt;activity android:name=\".LaunchScreenActivity\">\n        &lt;intent-filter>\n            &lt;action android:name=\"android.intent.action.MAIN\" \/>\n\n            &lt;category android:name=\"android.intent.category.LAUNCHER\" \/>\n        &lt;\/intent-filter>\n    &lt;\/activity>\n\n    &lt;activity android:name=\".MainActivity\" \/>\n&lt;\/application><\/code><\/pre>\n\n\n\n<p>\u5230\u6b64\uff0c<\/p>\n\n\n\n<p>LaunchScreen\u5c31\u505a\u5b8c\u4e86\u3002<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>\u4ee5\u4e0a\u662fLaunchScreen\u7684\u7c21\u55ae\u505a\u6cd5\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5e02\u9762\u4e0a\u4e0d\u5c11\u61c9\u7528\u7a0b\u5f0f\u90fd\u6709\u555f\u52d5\u756b\u9762\u3002 \u7c21\u55ae\u4f86\u8aaa\uff0c\u555f\u52d5\u756b\u9762\u53ea\u662f\u4e00\u500b\u5168\u87a2\u5e55\u4e26\u986f\u793a\u81ea\u5df1Logo\u7684Activity\u3002 \u51fa\u73fe &hellip; <\/p>\n","protected":false},"author":1,"featured_media":299,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[10,17],"class_list":["post-424","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-2","tag-android-app","tag-java"],"_links":{"self":[{"href":"https:\/\/blog.ray650128.com\/index.php?rest_route=\/wp\/v2\/posts\/424","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ray650128.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ray650128.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ray650128.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ray650128.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=424"}],"version-history":[{"count":3,"href":"https:\/\/blog.ray650128.com\/index.php?rest_route=\/wp\/v2\/posts\/424\/revisions"}],"predecessor-version":[{"id":1022,"href":"https:\/\/blog.ray650128.com\/index.php?rest_route=\/wp\/v2\/posts\/424\/revisions\/1022"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.ray650128.com\/index.php?rest_route=\/"}],"wp:attachment":[{"href":"https:\/\/blog.ray650128.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=424"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ray650128.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=424"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ray650128.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=424"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}