Okay, so i'm very new to this android development. I have a button. i want this button to open the pick image from... kinda activity so the user can pick image from system or different gallery apps he has or camera or web. like other apps who do so. I want that the image selected will get the image id and store it to a database, and display the image as the button. I will do the storing, but how do i get image ID? and all the other stuff? thanks alot for anyone who helps me! Cheers!
Add request code:
public class add_requests extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.add_requests);
}
Globals mThumbIds = Globals.getInstance();
public void onSaveClick(View view){
EditText desc = (EditText) findViewById(R.id.request_name);
EditText message = (EditText) findViewById(R.id.request_message);
String message1 = message.getText().toString();
String desc1 = desc.getText().toString();
Request r1 = new Request(R.drawable.iphone, message1,desc1);
mThumbIds.getData().add(r1);
finish();
}
public void browsePictures(){
Intent i = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.INTERNAL_CONTENT_URI);
}
}