• Post Reply Bookmark Topic Watch Topic
  • New Topic

Reflection & Creating Objects  RSS feed

 
R Sharp
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am trying out Reflection for the first time, I am trying to dynamically create an instance of a class Fragment.

I am currently getting an IllegalArgumentException:

Exception in thread "main" java.lang.IllegalArgumentException: wrong number of arguments
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)

I want to use the following constructor from Fragment:


My current attempt to do this so far is as follows:



Could the error possibly have something to do with me using a 2D array...?

Thanks for any help! =-)
 
R Sharp
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, I found a solution here finally:

http://www.daniweb.com/forums/thread246306.html#
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!