2011-12-12 210 views
0

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

回答

0
title.setText(this.getTitle()); 

這是記錄不完整here