0
我已經實現了使用以下的自定義標題欄功能class CustomWindow
。其他活動由此class CustomWindow
擴展。例如public class SimpleSearch extends CustomWindow {}
。問題是我想讀取其他原始活動的標題並將其顯示在Textview title
的class CustomWindow
中。我怎樣才能做到這一點?標題的自定義標題欄
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);
}
}