如何在Intent中设置Activity Title?

Jes*_*lan 1 android android-intent

TabHost我们能做到getActionBar().setTitle("ACTITIVTY TITLE").

但是intent呢?

有没有办法设置标题intent

  Intent i = new Intent(MenuActivity.this, DrawerListActivity.class);
                startActivity(i);
                Toast.makeText(getBaseContext(), "RF number: " +
                        KEY_RFnumber, Toast.LENGTH_SHORT).show();
Run Code Online (Sandbox Code Playgroud)

Yuv*_*Raj 6

MainActivity.class

public void send(View view) {
  Intent intent = new Intent(this, DrawerListActivity.class);
  String message = "Drawer Title";
  intent.putExtra("key", message);
  startActivity(intent);
}
Run Code Online (Sandbox Code Playgroud)

DrawerListActivity.class,in onCreate()

String message = getIntent().getStringExtra("key").toString(); // Now, message has Drawer title
setTitle(message); 
Run Code Online (Sandbox Code Playgroud)

现在,将此消息设置为标题.