In the onClick method I use the following structure:
Intent intent = new Intent(context, FullScreenViewActivity.class); intent.putExtra("position", position); intent.putStringArrayListExtra("items_to_parse", (ArrayList<String>) allPhoto); allPhoto.add(0, "link"); context.startActivity(intent); Inserting any link in the "link" field, opens the image, not quite correctly, but the essence itself. Now I want to do the same thing, but getting a specific link, namely, getting it from my model as follows:
allPhoto.add(imageUploads.get(position).getUrl()); But I get an error, and I can't see which one, since logcat does not open. ImageUpload class:
public class ImageUpload { @SerializedName("success") @Expose private Boolean success; @SerializedName("output_metadata") @Expose private OutputMetadata outputMetadata; @SerializedName("handler") @Expose private Integer handler; @SerializedName("id") @Expose private String id; private List<VideoUpload> videoUploads = new ArrayList<>(); @SerializedName("url") @Expose private String url; public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } public List<VideoUpload> getVideoUploads() { return videoUploads; } public void setVideoUploads(List<VideoUpload> videoUploads) { this.videoUploads = videoUploads; } boolean loadImage = false; String Path; public boolean isLoadImage() { return loadImage; } public void setLoadImage(boolean loadImage) { this.loadImage = loadImage; } public String getPath() { return Path; } public void setPath(String path) { Path = path; } public Boolean getSuccess() { return success; } public void setSuccess(Boolean success) { this.success = success; } public OutputMetadata getOutputMetadata() { return outputMetadata; } public void setOutputMetadata(OutputMetadata outputMetadata) { this.outputMetadata = outputMetadata; } public Integer getHandler() { return handler; } public void setHandler(Integer handler) { this.handler = handler; } public String getId() { return id; } public void setId(String id) { this.id = id; } VideoUpload class VideoUpload
public class VideoUpload { @SerializedName("id") @Expose private String id; @SerializedName("videoUrl") @Expose String videoUrl; @SerializedName("user_portrait_huge") @Expose private String userPortraitHuge; @SerializedName("url") @Expose private String url; public String getUserPortraitHuge() { return userPortraitHuge; } public void setUserPortraitHuge(String userPortraitHuge) { this.userPortraitHuge = userPortraitHuge; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } boolean loadImage = false; public String getVideoUrl() { return videoUrl; } public void setVideoUrl(String videoUrl) { this.videoUrl = videoUrl; } public String getId() { return id; } public void setId(String id) { this.id = id; } public boolean isLoadImage() { return loadImage; } public void setLoadImage(boolean loadImage) { this.loadImage = loadImage; } FullScreenViewActivity
public class FullScreenViewActivity extends Activity { private FullScreenImageAdapter adapter; private ViewPager viewPager; ArrayList<String> photo = new ArrayList<>(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_fullscreen_view); viewPager = (ViewPager) findViewById(R.id.pager); int position = 0; Intent i = getIntent(); if (i != null) { position = i.getIntExtra("position", 0); photo.addAll(getIntent().getExtras().getStringArrayList("items_to_parse")); } Display display = getWindowManager().getDefaultDisplay(); Point size = new Point(); display.getSize(size); int width = size.x; // int height = size.y; adapter = new FullScreenImageAdapter(FullScreenViewActivity.this, photo,width); viewPager.setAdapter(adapter); viewPager.setCurrentItem(position); } }

VideoUploadclass and the full code of theImageUploadclass. - post_zeewimageUploads- what class object? - post_zeew