Hi darolla,
Thanks for the post....!!
But I want to have a common code to which I can send Image and text<title> for all the different screens,but the main content will be set in the individual screens.
I am posting the sample code [ few things borrowed from ur post

]
- Code: Select all
public class MyActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Bitmap image = BitmapFactory.decodeResource(getApplicationContext().getResources(),
R.drawable.lil_opensource);
String Title = "Amigo!";
boolean Rq = requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
System.out.println(" Window Feature :"+Rq);
setContentView(R.layout.my);
Custom c = new Custom();
[b]c.customtitle(Title, image,this);[/b]
}
}
The above code will call the common Title settting code.
- Code: Select all
public class Custom extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
public void customtitle(String Title,Bitmap image,Activity activity) {
System.out.println("Title is :"+Title);
this.image = image;
this.Title = Title;
activity.getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.my_title);
((RelativeLayout)findViewById(R.id.header)).setBackgroundColor(Color.WHITE);
((TextView)findViewById(R.id.title)).setText(Title);
((ImageView)findViewById(R.id.back)).setImageBitmap(image);
}
}
But currently I am getting Null Pointer exception on the findViewById for header!!!
Can we achieve this i.e: setting a part{ Title } of the screen in one class and the rest of the content { Main } in the other class.
Please help me in this regard!!!
Thanks and Regards,
Andy