I click on the image and it lets me select one from the gallery, but when I select it, it does not change. I know I'm missing part of the code, could someone help me with it? Thanks!
MainActivity:
public class MainActivity extends AppCompatActivity {
private static final int PHOTO_SELECTED = 1;
ImageButton fotoH;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
fotoH = (ImageButton) findViewById(R.id.pruebah);
fotoH.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("image/*");
startActivityForResult(intent, PHOTO_SELECTED);
}
});
}
}