1

I want to know how to save an image from my app gallery to my phone gallery with a button click. Here is the code. Tell if I need to add the other activities called ImageAdapter and galleryflow.

public class MainActivity extends Activity {
private GalleryFlow mGalleryFlow;

private int[] imageIds = new int[] { R.drawable.sdfs, R.drawable.sdfds,
        R.drawable.sdfsd, R.drawable.sdfds, R.drawable.sdf,
        R.drawable.sdfsdf, R.drawable.sdfsdf, R.drawable.sdfsu,
        R.drawable.ssdfsdf, R.drawable.sfsdfdsfs, R.drawable.sdfsfs,
        R.drawable.tisdfsd, R.drawable.tsdfdsfe };

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

     but1 = (Button) findViewById(R.id.but1);

     but1.setOnClickListener(myhandler1);

    findViews();
    initViews();
}

  View.OnClickListener myhandler1 = new View.OnClickListener() {
public void onClick(View v) {

  }
};

private void findViews() {
    mGalleryFlow = (GalleryFlow) findViewById(R.id.gf);
}

private void initViews() {
    ImageAdapter adapter = new ImageAdapter(this, imageIds);

    adapter.createReflectedImages();
    mGalleryFlow.setAdapter(adapter);
}

}
rds
  • 26,253
  • 19
  • 107
  • 134

0 Answers0