Skip to content Skip to sidebar Skip to footer

Accessing Array With Object

hi i have two classes in android and in one class i have write an array and i want to access it in the main class but the error is give me that 'force closed' here is my code pack

Solution 1:

First of all: the constructor in your second class would not be used. The way to pass parameters to another activity is to use Intent.putExtra in the code calling the other activity and in your other activity use

Bundleextras= getIntent().getExtras(); 
if(extras !=null)
{
    Stringvalue= extras.getString("keyName");
}

to get the data in onCreate.

That said, I guess the problem arises from your second class not providing an explicit parameterless constructor.

Post a Comment for "Accessing Array With Object"