Android: How to check which Fragment/Activity called the method -
my case follows, have common toolbar between activities and fragments, have method attached toolbar (like button) can called all, however, want method behave differently according activity/fragment called it.so should code inside method?
here code
public boolean onsupportnavigateup(){ intent mainactivity=new intent(this,main_activity.class); mainactivity.addflags(intent.flag_activity_clear_top); startactivity(mainactivity); this.finish(); return true; }
use putextra , getextra intent , set different values different activity in put identify exact calling activity/fragment.
Comments
Post a Comment