
package com.exercise.AndroidTitleBar;
import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
public class AndroidTitleBarActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
View title = getWindow().findViewById(android.R.id.title);
View titleBar = (View) title.getParent();
titleBar.setBackgroundColor(Color.CYAN);
}
}
Source :http://android-er.blogspot.in/2011/07/set-background-color-of-title-bar.html
No comments:
Post a Comment