my question is how i can add a title on ListActivity
I used the following code
final boolean customTitleSupported = requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
if ( customTitleSupported )
{
getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.titlebar);
}
final TextView myTitleText = (TextView) findViewById(R.id.myTitle);
if ( myTitleText != null开发者_如何学编程 )
{
myTitleText.setText("Select Service Provider");
}
But it not works on ListActivity
If nothing else works, you can extend Activity instead of ListActivity, and in your layout you can place a ListView that you bind your data to.
精彩评论