guyz i got my answer one of my friend shared a link with me which have solved my problem
the link is: same header on all the activites working like same on all
Complete Answer after applying:
this is BaseActivity class used to give functionalities to header
abstract public class BaseActivity extends Activity{
ImageView imVBattery,imVWIFI,imVSabaqLogo;
Button btnSettings,btnTheme;
WifiManager wifiManager;
//set resources to all the contols
public void setHeader(){
imVBattery=(ImageView)findViewById(R.id.imVBattery);
imVWIFI=(ImageView)findViewById(R.id.imVWIFI);
imVSabaqLogo=(ImageView)findViewById(R.id.imVSabaqLogo);
btnSettings=(Button)findViewById(R.id.btnSettings);
btnTheme=(Button)findViewById(R.id.btnTheme);
wifiManager= (WifiManager)this.getSystemService(getBaseContext().WIFI_SERVICE);
}
}
and this is my main class in which i extends this base activity:
public class Main extends BaseActivity implements OnClickListener{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.s_main);
//with the help of this i assign all resources to controls of headers
setHeader();
}
}
thanks to all who replied and helped me.!