my problem is that I create java code with Freemarker and I need the type of a variable, which is not initialized. I need the type, because there are specified methods for each class type.
So I have a custom class that implements from Parcelable.
int id;
public MyClass(Parcel parcel) {
if(id.getClass().toString().equals("Long")) id=parcel.readLong();
if(id.getClass().toString().equals("String")) id=parcel.readString();
}
I know there is a method readValue() but that solved not my problem, because the same problem is, if I want to write the Objects.
So that is the main problem. I hope you understand this and you can help.
Thanks