我已经使用以下class CustomWindow实现了自定义标题栏功能。其他活动由该class CustomWindow扩展。例如public class SimpleSearch extends CustomWindow {}。问题是我想要读取其他原始活动的标题,并将其显示在class CustomWindow的Textview title中。我该怎么做呢?
public class CustomWindow extends ListActivity {
protected TextView title;
protected ImageView icon;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
setContentView(R.layout.main);
getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.window_title);
title = (TextView) findViewById(R.id.title);
icon = (ImageView) findViewById(R.id.icon);
}
}发布于 2011-12-13 06:25:04
title.setText(this.getTitle());这是一个文档很少的here。
https://stackoverflow.com/questions/8481291
复制相似问题