android - How can I access a view of an activity from another activity -


I need to hide TabHost's tabs from child activity I tried getParent () and this Also did not work

Also tried:

  TabHost th = (TabHost) ((TabsActivity) getBaseContext ()) .findViewById (android.R.id.tabhost) ; Th.setVisibility (View.INVISIBLE);   

but it throws a nullpointer

never access directly Current Activity to other activities owned by , because they can be recycled during this time (because there may be other activity That has been destroyed in the meantime.)

You need to communicate in a standard way to other activity For example, your child activity results to parent activity , which it can then explain (you value to intent ). Another solution is using a static variable, but it is not very good and if you are not careful enough then its risk.

For more information about communication between actions, see and.

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -