title: Add Profile Picture to each account and stored into database - cloud Firestore
body: <p>I want to make adding a Profile picture special it to the account and it's saved (store) into database - cloud Firestore as a  special Profile picture  for each account </p>
  
  <p>for example to more explain:</p>
  
  <h1>there are two users use my application and all of them want special Profile picture for they Profile , how can I store this image to each of them in each database account and Display automatically if a user logs in to his Profile</h1>
  
  <p>following the code of the Profile java and activity </p>
  
  <p>Profile.Java </p>
  
  <pre><code>public class Child_Profile extends AppCompatActivity {
  private TextView name;
  private TextView gender;
  private TextView birth;
  private TextView bload;
  private TextView Text_Dates;
  private TextView Text_Time;
  private Button Button_record;
  private TextView Text_record;
  private TextView Text_hospial;
  private TextView Text_Plan;
  private TextView Text_Satus;
  private TextView Text_Price;
  private ImageView ImageView_choose_image;
  private Button button_choose_image;
  private  Uri mUri;
  private static final int GALLERY_INTENT = 1;
  
  
  private StorageReference mStorage;
  private DatabaseReference mData;
  private FirebaseFirestore db = FirebaseFirestore.getInstance();
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
      getMenuInflater().inflate(R.menu.main_menu,menu);
      return true;
  }
  
  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
      if (item.getItemId()==R.id.action_sign_out)
          signOut();
      return true;
  }
  
  private void signOut() {
      AuthUI.getInstance().signOut(this)
              .addOnCompleteListener(new OnCompleteListener&lt;Void&gt;() {
                  @Override
                  public void onComplete(@NonNull Task&lt;Void&gt; task) {
                      startActivity(new Intent(Child_Profile.this,User.class));
                      finish();
                  }
              });
  }
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_child__profile);
  
      name = findViewById(R.id.text_view_Namee);
      gender = findViewById(R.id.text_view_Gender);
      birth = findViewById(R.id.text_view_Birth);
      bload = findViewById(R.id.text_view_Blood);
      Text_Dates = findViewById(R.id.Text_Dates);
      Text_Time = findViewById(R.id.Text_Time);
      Text_record = findViewById(R.id.Text_record);
      Text_hospial = findViewById(R.id.Text_hospial);
      Text_Plan = findViewById(R.id.Text_Plan);
      Text_Satus = findViewById(R.id.Text_Satus);
      Button_record = findViewById(R.id.Button_record);
      Text_Price = findViewById(R.id.Text_Price);
      button_choose_image = findViewById(R.id.button_choose_image);
      ImageView_choose_image = findViewById(R.id.ImageView_choose_image);
      mStorage = FirebaseStorage.getInstance().getReference("Photo");
      mData = FirebaseDatabase.getInstance().getReference("Photo");
  
  
      button_choose_image.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View view) {
              openFileChooser();
  
          }
      });
  
      Intent in = getIntent();
      final Bundle b = in.getExtras();
      if (b != null) {
  
          String n = (String) b.get("id");
  
          db.collection("Child Profile").document(n).get()
                  .addOnSuccessListener(new OnSuccessListener&lt;DocumentSnapshot&gt;() {
                      @Override
                      public void onSuccess(DocumentSnapshot documentSnapshot) {
                          String pName = documentSnapshot.getString("name");
                          String pgender = documentSnapshot.getString("gender");
                          String pbirth = documentSnapshot.getString("birth");
                          String pbload = documentSnapshot.getString("bload");
                          String pDates = documentSnapshot.getString("dates");
                          String pTime = documentSnapshot.getString("time");
                          String pHospital = documentSnapshot.getString("hospital");
                          String pPlan = documentSnapshot.getString("typeOfPlan");
                          String pSatus = documentSnapshot.getString("satus");
                          String pPrice = documentSnapshot.getString("price");
  
  
                          name.setText(pName);
                          gender.setText(pgender);
                          birth.setText(pbirth);
                          bload.setText(pbload);
                          Text_Dates.setText(pDates);
                          Text_Time.setText(pTime);
                          Text_hospial.setText(pHospital);
                          Text_Plan.setText(pPlan);
                          Text_Satus.setText(pSatus);
                          Text_Price.setText(pPrice);
  
  
                      }
                  });
  
      }
  
  
  }
  
  
  
  
  private void openFileChooser() {
  
      Intent intent = new Intent();
      intent.setType("image/*");
      intent.setAction(Intent.ACTION_GET_CONTENT);
      startActivityForResult(intent, GALLERY_INTENT);
  }
  
  @Override
  protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
      super.onActivityResult(requestCode, resultCode, data);
      if (requestCode == GALLERY_INTENT &amp;&amp; resultCode == RESULT_OK &amp;&amp; data != null &amp;&amp; data.getData()!= null) {
  
          mUri = data.getData();
          Picasso.with(this).load(mUri).into(ImageView_choose_image);
  
  
  
      }
  }
  
  public void ImageView_choose_image(View view) {
  
  }
  </code></pre>
  
  <p>Profile.Xml</p>
  
  <pre><code>    &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="200dp"
          android:background="@color/colorPrimaryDark"
          android:orientation="vertical"&gt;
  
          &lt;ImageView
              android:id="@+id/ImageView_choose_image"
              android:layout_width="86dp"
              android:layout_height="68dp"
              android:layout_gravity="center_horizontal"
              android:layout_marginTop="45dp"
              android:onClick="ImageView_choose_image"/&gt;
  
          &lt;Button
              android:id="@+id/button_choose_image"
              android:layout_width="wrap_content"
              android:layout_height="68dp"
              android:layout_gravity="center_horizontal"
              android:layout_marginTop="-110dp"
              android:background="@null"
              android:text="chid Picture" /&gt;
  
          &lt;TextView
              android:id="@+id/text_view_Namee"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_gravity="center_horizontal"
              android:layout_marginTop="40dp"
              android:text="Name"
              android:textColor="@android:color/white"
              android:textSize="25dp"
              android:textStyle="bold" /&gt;
  
  
      &lt;/LinearLayout&gt;
  
      &lt;android.support.v7.widget.CardView
          android:layout_width="350dp"
          android:layout_height="100dp"
          android:layout_marginLeft="10dp"
          android:layout_centerHorizontal="true"
          android:layout_marginTop="160dp"&gt;
  
          &lt;LinearLayout
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:orientation="horizontal"
              android:weightSum="3"&gt;
  
              &lt;LinearLayout
                  android:layout_width="0dp"
                  android:layout_height="match_parent"
                  android:layout_weight="1"
                  android:gravity="center"
                  android:orientation="vertical"&gt;
  
                  &lt;TextView
                      android:id="@+id/text_view_Gender"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:text="Gender"
                      android:textSize="20dp" /&gt;
  
  
              &lt;/LinearLayout&gt;
  
              &lt;LinearLayout
                  android:layout_width="0dp"
                  android:layout_height="match_parent"
                  android:layout_weight="1"
                  android:gravity="center"
                  android:orientation="vertical"&gt;
  
                  &lt;TextView
                      android:id="@+id/text_view_Birth"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:text="Birth Day"
                      android:textSize="20dp" /&gt;
  
  
              &lt;/LinearLayout&gt;
  
              &lt;LinearLayout
                  android:layout_width="0dp"
                  android:layout_height="match_parent"
                  android:layout_weight="1"
                  android:gravity="center"
                  android:orientation="vertical"&gt;
  
                  &lt;TextView
                      android:id="@+id/text_view_Blood"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:text="Blood Type"
                      android:textSize="20dp" /&gt;
  
              &lt;/LinearLayout&gt;
  
          &lt;/LinearLayout&gt;
  
  
      &lt;/android.support.v7.widget.CardView&gt;
  &lt;LinearLayout
      android:layout_marginTop="20dp"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:gravity="center"
      android:orientation="horizontal"&gt;
      &lt;LinearLayout
  
          android:layout_marginTop="50dp"
          android:layout_width="30dp"
          android:layout_height="wrap_content"
          android:layout_weight="9"
          android:orientation="horizontal"&gt;
  
          &lt;ImageView
              android:layout_width="50dp"
              android:layout_height="65dp"
              android:background="@drawable/calendar"/&gt;
  
  
          &lt;TextView
              android:id="@+id/Text_Dates"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_marginTop="40dp"
              android:text="Dates" /&gt;
  
          &lt;TextView
              android:id="@+id/Text_Time"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_marginTop="10dp"
              android:layout_marginLeft="-35dp"
              android:text="Time" /&gt;
  
      &lt;/LinearLayout&gt;
  &lt;/LinearLayout&gt;
  &lt;LinearLayout
      android:layout_marginTop="240dp"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:gravity="center"
      android:layout_marginLeft="-1dp"
      android:orientation="horizontal"&gt;
      &lt;LinearLayout
  
          android:layout_marginTop="70dp"
          android:layout_width="30dp"
          android:layout_height="wrap_content"
          android:layout_weight="9"
          android:orientation="horizontal"&gt;
          &lt;ImageView
              android:layout_width="50dp"
              android:layout_height="65dp"
              android:layout_marginTop="25dp"
              android:background="@drawable/recodbook" /&gt;
  
          &lt;TextView
              android:id="@+id/Text_Plan"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_marginTop="30dp"
              android:text="Plan" /&gt;
  
          &lt;TextView
              android:id="@+id/Text_Price"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_marginTop="50dp"
              android:layout_marginLeft="-30dp"
              android:padding="2dp"
              android:text="Price" /&gt;
  
          &lt;TextView
              android:id="@+id/Text_Satus"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_marginLeft="-30dp"
              android:padding="2dp"
              android:layout_marginTop="70dp"
              android:text="Satus" /&gt;
  
  
      &lt;/LinearLayout&gt;
  &lt;/LinearLayout&gt;
  
  &lt;LinearLayout
      android:layout_marginTop="20dp"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:gravity="center"
      android:layout_marginLeft="180dp"
      android:orientation="horizontal"&gt;
      &lt;LinearLayout
  
          android:layout_marginTop="50dp"
          android:layout_width="30dp"
          android:layout_height="wrap_content"
          android:layout_weight="9"
          android:orientation="horizontal"&gt;
  
          &lt;Button
              android:id="@+id/Button_record"
              android:layout_width="50dp"
              android:layout_height="65dp"
              android:layout_marginLeft="20dp"
              android:background="@drawable/record" /&gt;
  
          &lt;TextView
              android:id="@+id/Text_record"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_marginLeft="5dp"
              android:text="your record" /&gt;
  
      &lt;/LinearLayout&gt;
  &lt;/LinearLayout&gt;
  &lt;LinearLayout
      android:layout_marginTop="250dp"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:gravity="center"
      android:layout_marginLeft="160dp"
      android:orientation="horizontal"&gt;
      &lt;LinearLayout
  
          android:layout_marginTop="70dp"
          android:layout_width="30dp"
          android:layout_height="wrap_content"
          android:layout_weight="9"
          android:orientation="horizontal"&gt;
          &lt;ImageView
              android:layout_width="50dp"
              android:layout_height="65dp"
              android:layout_marginLeft="6dp"
              android:layout_marginTop="5dp"
              android:src="@drawable/medical" /&gt;
  
          &lt;TextView
              android:id="@+id/Text_hospial"
              android:layout_width="150dp"
              android:layout_height="wrap_content"
              android:layout_marginTop="25dp"
              android:gravity="center"
              android:text="your hospital" /&gt;
  
  
      &lt;/LinearLayout&gt;
  &lt;/LinearLayout&gt;
  </code></pre>