I have a class like this :
import java.util.ArrayList;
/* Get ArrayList of UserModel type */
public class GetUserModelData {
public static ArrayList<UserModel> getUserModelData() {
ArrayList<UserModel> arrayList = new ArrayList<>();
arrayList.add(new UserModel("Droid", "droid@gmail.com"));
arrayList.add(new UserModel("John", "john@gmail.com"));
arrayList.add(new UserModel("David" , "david@gmail.com"));
arrayList.add(new UserModel("Humpy", "humpy@gmail.com"));
arrayList.add(new UserModel("Sharma", "sharma@gmail.com"));
arrayList.add(new UserModel("Dravid", "dravid@gmail.com"));
return arrayList;
}
}
I want use getString instead hardcode text. Because this ArrayList dataset is use for multiple Fragment.
Can anyone helpme.