Android Application Name Appears as Activity Name

前端 未结 6 2023
长发绾君心
长发绾君心 2020-12-15 17:27

I have reviewed the manifest for application, and under apps launcher it displays as Activity Name rather than its app name? Why is this. I have another application where w

6条回答
  •  感情败类
    2020-12-15 17:46

    One way to have a different application name (the name that appears under the app icon) and a different name for the activity that is being launched when you tap on the app icon is to explicitly set a different string in the activity's onCreate() method, like this:

    @Override
    public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
    
      // Do your thing
      // ... bla bla bla
    
      getActionBar().setTitle(R.string.activity_title);
    }
    

    Hope this helps!

提交回复
热议问题