I am developing a simple app for videos by using android camera. In my app I have a button having name "Make Video " and a list view which is for to show the video name recorded by my app. Now as I click the button it opens my mobile camera for recording but when I complete my recording the camera gives me two options. "Save" and "Discard". Now by clicking the "Save" option, I want to get the name of the recorded video and display it on my list view. Please help me I would be very thankful to you.
You can check my code below.
ImageView iv;
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
list =(ListView) findViewById(R.id.list);
iv = (ImageView) findViewById(R.id.imageView1);
Button makeVideo = (Button) findViewById(R.id.button1);
makeVideo.setOnClickListener(new OnClickListener()
{
@Override
public void onClick(View v)
{
//Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
Intent intent = new Intent(android.provider.MediaStore.ACTION_VIDEO_CAPTURE);
startActivityForResult(intent, 0);
}
});
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data)
{
// TODO Auto-generated method stub
super.onActivityResult(requestCode, resultCode, data);
// Bitmap bm = (Bitmap) data.getExtras().get("data");
// iv.setImageBitmap(bm);
}