Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
【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