I have a question about creating an App.
I need to put the user's profile photo in my Nav_Header_Tel_Princial.
Ialreadyhaveaprofilescreen,butIneedtousethesameimagefromtheuserprofilescreenformyNAV.
Theprofilescreenisworkingcorrectly,Icansavetheimage,howeverIjustneedtousethesameUriontheotherscreen.
IhavenotyetbeenabletocreateanycodebecauseIhavenoideawhattosearchfor.Ineedalightonhowtoaccomplishthis.
protectedvoidonCreate(BundlesavedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.activity_settings);
Bundlebundle=newBundle();bundle.putString("foto", resultUri.toString());
Intent intent = new Intent(SettingsActivity.this, TelaPrincipalActivity.class);
intent.putExtras(bundle);
startActivity(intent);
edtNameField = (EditText) findViewById(R.id.edtName);
edtPhoneField = (EditText) findViewById(R.id.edtPhone);
imgProfileImage = (ImageView) findViewById(R.id.imgProfileImage);
btnBack = (Button) findViewById(R.id.btnBack);
btnConfirm = (Button) findViewById(R.id.btnConfirm);
mAuth = FirebaseAuth.getInstance();
userID = mAuth.getCurrentUser().getUid();
mCustomerDatabase = FirebaseDatabase.getInstance().getReference().child("Users").child(userID);
getUserInfo();
imgProfileImage.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(Intent.ACTION_PICK);
intent.setType("image/*");
startActivityForResult(intent, 1);
}
});
This would be the activity that should receive Uri data.
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_tela_principal);
Intent intent = getIntent();
Bundle bundle = intent.getExtras();
String foto = bundle.getString("foto");
btnTest = (Button) findViewById(R.id.BtnTest);
btnTest.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
openBtnTest();
}
});
edtSearch = (TextView) findViewById(R.id.edtSearch);
edtSearch.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
search();
}
});