android - Can Fragments use the logic from main_activity.java? -


so, using activity recognition api know state of user, , implementing google fit does.

i have written logic app in main_activity.java , class made activityrecognition. , have xml in activity_main.xml

pretty usual stuff till now.

well problem arises when want integrate code in tab layout material design uses fragments , viewpager display.

if copy activity_main.xml fragment_one.xml, have copy logic activityrecognition api fragment_one.java or not ?

very confused, do.


Comments

Popular posts from this blog

java - pagination of xlsx file to XSSFworkbook using apache POI -

Unlimited choices in BASH case statement -

apache - How do I stop my index.php being run twice for every user -