i have a relative layout in navigation drawer. and it includes a textview and an imageview. i set onClick attribute="onMenuHome" tu relative layout
public void onMenuHome(View v) {
RelativeLayout rlayHome = (RelativeLayout) findViewById(R.id.rlay_main_home);
ImageView imgvHome = (ImageView) findViewById(R.id.imgv_main_home);
TextView txtvHome = (TextView) findViewById(R.id.txtv_main_home);
rlayHome.setBackgroundResource(R.color.clr_disabledLight);
imgvHome.setBackgroundResource(R.drawable.ic_home_c);
txtvHome.setTextColor(getResources().getColor(R.color.clr_primaryColor));
Fragment fragment = new HomeFragment();
FragmentManager fragmentManager = getSupportFragmentManager();
fragmentManager.beginTransaction()
.replace(R.id.frml_main_fragment, fragment).commit();
mTitle = getResources().getString(R.string.str_home);
getSupportActionBar().setTitle(mTitle);
mDrawerLayout.closeDrawers();
}
so background of relative layout and textcolor of textview changes. but it cant change imageview's src. can anyone help me?