我无法弄清楚为什么我会收到 NullPointerException。我在这里想念什么?
public class CustomJourneyUserInformation {
public IJourneyDetails journeyDetails;
public IUserDetails userDetails;
public ISubscribeJourney subscribedToJourneys;
}
IJourneyDetails、IUserDetails、ISubscribeJourney都是接口
在另一个活动中,我打电话给
private CustomJourneyUserInformation[] allJourneyDetails;
allJourneyDetails = new CustomJourneyUserInformation[subscribedToJourneys.length];
if (providerDetails[i] != null)
>>> allJourneyDetails[i].journeyDetails = providerDetails[i];
if (userDetails[i] != null)
allJourneyDetails[i].userDetails = userDetails[i];
if (subscribedToJourneys[i] != null)
allJourneyDetails[i].subscribedToJourneys = subscribedToJourneys[i];
我在由 >>>> 标记的行中收到空指针异常
我确定allJourneyDetails[i]
这里是空的。