Skip to content

Instantly share code, notes, and snippets.

@codeforfun-jp
Created August 1, 2021 07:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codeforfun-jp/03f47c591f1f20b66662d7f20b673d4e to your computer and use it in GitHub Desktop.
Save codeforfun-jp/03f47c591f1f20b66662d7f20b673d4e to your computer and use it in GitHub Desktop.
【Android Studio】アクションバーの文字列を変更する方法
package com.example.myapplication;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setTitle("テキスト");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment