I want to know if reflection in android can affect the outside class (class 
A
lets say i have class A 

which have a method setData:
 
public void setData(int id){
editText1.setText(id+"");
}





and class B ;
I send A.class as parameter to class B represent by c.



Object obj = c.newInstance();
Method method1 = c.getMethod("setData", new Class[]{Integer.TYPE});
method1.setAccessible(true);
method1.invoke(obj, 3)





this code is working in the inside class(class B) but outside in the 
original class A like I didn't change anything.

thanks in advance.


-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/1b449740-2f77-49af-8f34-0d7724ab00ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to