Android将图像另存为收藏夹

Android将图像另存为收藏夹,android,Android,我有一个应用程序,它有大约100个图像,存储在drawable文件夹中。现在我想在该图像中放置一个收藏夹按钮。如果用户点击该按钮,该特定图像将保存到收藏夹活动中。我使用viewpager显示图像。 请告诉我怎么做 将该特定id存储在arrayList中,并在FAV活动中使用该arrayList。在适配器中执行以下操作 @Override public Object instantiateItem(ViewGroup container, int position) { final Vie

我有一个应用程序,它有大约100个图像,存储在drawable文件夹中。现在我想在该图像中放置一个收藏夹按钮。如果用户点击该按钮,该特定图像将保存到收藏夹活动中。我使用viewpager显示图像。
请告诉我怎么做

将该特定id存储在arrayList中,并在FAV活动中使用该arrayList。

在适配器中执行以下操作

@Override
public Object instantiateItem(ViewGroup container, int position) {
    final View itemView = mLayoutInflater.inflate(R.layout.boost, container, false);

    final AdapterList list = adapterList.get(position);

    final ImageView image = (ImageView) itemView.findViewById(R.id.image);
    image.setImageDrawable(getResources().getDrawable(R.drawable.image_name));

    final Button favorite = (Button) itemView.findViewById(R.id.favorite_button);

        activateButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {

            if (!isFavorite) {
                    saveAsFavorite(list.getPackageId());
                    isFavorite= true;
                }else{
                    notFavorite(list.getPackageId());
                    isFavorite= false;
                }
            }
        });

    container.addView(itemView);

    return itemView;
}

你能详细说明一下吗?我的应用程序中有100张图片。我有主活动和收藏夹活动。我使用查看页面显示图片。现在,如果用户喜欢该用户的任何图片,可以单击底部栏上的按钮。当他单击该按钮时,图片保存在收藏夹活动中。用户可以显示这些图片。如果他将10张图片作为收藏夹,则在收藏夹活动中,用户可以看到这10幅图像。
该特定图像将保存到收藏夹活动中。
。无法在“活动”中保存图像。活动不是储存场所。可以在活动中显示图像是。现在告诉我们活动如何知道它必须显示哪些图像。重新启动后是否应显示相同的内容?