tags:

views:

18

answers:

2

Hey guys..

I'm recieving a Float Array from a Bundle like so...

         Bundle b = this.getIntent().getExtras(); 
         float camObjCoord[] = b.getFloatArray("tweets");

Sadly I'm not being allowed make the data public. It will only allow final.. what would be the best way around this?

A: 

First of all, final has nothing to do with public

With regards to your problem, if the only thing you care about is changing the content of the array without the need of reflect those changes on the original array, you can clone it:

final float original[] = b.getFloatArray("tweets");
float camObjCoord[] = (float[])original.clone();
Cristian
I wanted to make it public to pass it to a sub class of the Activity
Ulkmun
In that case, read the Pentium10 answer
Cristian
+1  A: 

Private classes inside of an activity can have access to private members of the parent class. So you need to make it a property of the class, not a local variable of the method.

Pentium10