简体   繁体   English

如何在Android应用程序的“开始”屏幕上添加徽标?

[英]How do I add logo on my start screen in android app?

I m making book finder app for the website, i want the logo to be on screen when the user first time launches the app 我正在为网站制作图书查找器应用程序,我希望用户首次启动该应用程序时在屏幕上显示徽标

Here is my code for Main Activity onCreate(): 这是我的主要活动onCreate()的代码:

protected void onCreate(Bundle savedInstanceState) {        
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    recyclerView = (RecyclerView)findViewById(R.id.recycler_view);
    recyclerView.setLayoutManager(new LinearLayoutManager(this));

    ImageView logo = (ImageView) findViewById(R.id.logo_view) ;

}

But it does not work 但这不起作用

I want it to look like this: 我希望它看起来像这样:

商标

You should create a Splash Screen, 您应该创建一个启动画面,

1 : Create one new Activity with your home screen design (as you mentioned above) 1:使用主屏幕设计创建一个新的活动(如上所述)

2: Set this new Activity (Splash Screen) as your home Activity 2:将此新活动(启动屏幕)设置为家庭活动

3: Finally, in your new Activity or Splash Activity close or finish your Splash Activity (after 4-5 seconds using Timer) and start or open next Activity which you want.. 3:最后,在新的活动或启动活动中,关闭或完成启动活动(使用计时器4-5秒后),然后启动或打开所需的下一个活动。

Thats it.. 而已..

Same you can get here How do I make a splash screen? 您可以在此处获得相同的信息如何制作启动画面?

1.Create seperate .java file for splashscreen Activity. 1.为启动画面活动创建单独的.java文件。

2.Create splashScreen .xml file seperately. 2.单独创建splashScreen .xml文件。

3.Open your your AndroidManifest.xml file and make your splash screen activity as Launcher activity. 3.打开您的AndroidManifest.xml文件,并将初始屏幕活动设置为Launcher活动。

 <activity
        android:name="packagepath.SplashScreen"



        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

Try those steps .And if you want more help when doing this inform me. 请尝试这些步骤。如果您在执行此操作时需要更多帮助,请通知我。 IF you got this inform me also 如果您知道了,也请通知我

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM