Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

calling activity method from fragment:

((YourActivityClassName)getActivity()).yourPublicMethod();
Comment

call fragment method from activity

YourFragmentClass fragment = (YourFragmentClass)fm.findFragmentByTag("yourTag");
Comment

fragment call activity

Intent myIntent = new Intent((ParentActivity)getActivity(), YourOtherActivity.class);
(ParentActivity)getActivity().startActivity(myIntent);
Comment

PREVIOUS NEXT
Code Example
Java :: hide icon android studio 
Java :: override onbackpressed in fragment 
Java :: java sample code 
Java :: what is packages in java 
Java :: inheritance in oop 
Java :: reverse a string in java 
Java :: sort comparator in java 
Java :: Caused by: java.lang.ClassNotFoundException 
Java :: quicksort for arraylist 
Java :: Finding the Sum of an Array in Java 
Java :: android textview center align text programmatically 
Java :: java write to file 
Java :: java program using FileOutputStream to create a file on mac 
Java :: spring security auto login after register 
Java :: java write to a file 
Java :: first character string number java 
Java :: file java class 
Java :: converting char array to string 
Java :: how to use a combo box in java with if else 
Java :: fixed length array powershell PSv5+ 
Java :: how to run java in eclipse 
Java :: java Overridding example 
Java :: button change text java 
Java :: java how to create an array 
Java :: java math ceil 
Java :: java newinstance alternative 
Java :: java generics type 
Java :: android pass object to activity 
Java :: on item click listener for recyclerview adapter 
Java :: remove all element in a list java 
ADD CONTENT
Topic
Content
Source link
Name
5+6 =