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)
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)
现在,将此消息设置为标题.
| 归档时间: |
|
| 查看次数: |
3326 次 |
| 最近记录: |