user3782779 user3782779 -4 years ago 126
Android Question

Get activity custom title view

In my activity I use custom title feature:

getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.myactivitytitle);

This works well, I can see myactivitytitle.xml elements in title of activity.

Now, I need to edit programatically elements of myactivitytitle.xml to do something like this:

View titleView = getTitleView();//This is the function I need
EditText et = titleView.findViewById(;

How I can get the view of the title to access its elements?

Answer Source

This is my In my activity I use custom title (R.layout.mytitle). there is a TextView in my title. i can get this TextView and i can set it's text with this code.

    getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.mytitle);
    TextView krdTxt = (TextView) findViewById(;
    krdTxt.setText("Faturalı Abone ");
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download