title: Firebase Profile Photo Retreive via uid
body: <p>i am Beginner please help me with this code..it shows nothing in image view...how can i get Profile image of the user currently login.  </p>
  
  <p>Here is my activity</p>
  
  <pre><code>import com.bumptech.glide.Glide;
  import android.content.Context;
  import android.content.SharedPreferences;
  import android.net.Uri;
  import android.os.Bundle;
  import android.support.v7.app.AppCompatActivity;
  import android.widget.ImageView;
  import android.widget.TextView;
  import com.squareup.picasso.Picasso;
  import com.google.firebase.auth.FirebaseAuth;
  import com.google.firebase.auth.FirebaseUser;
  import com.google.firebase.database.DatabaseReference;
  import com.google.firebase.database.FirebaseDatabase;
  import com.google.firebase.storage.FirebaseStorage;
  import com.google.firebase.storage.StorageReference;
  import com.squareup.picasso.Picasso;
  
  public class Profile extends AppCompatActivity {
      private FirebaseAuth mAuth;
      private DatabaseReference mDatabaseUsers;
      String post_key = null;
      private StorageReference mStorageRef;
      SharedPreferences sharedpreferences;
      public static final String MyPREFERENCES = "MyPrefs";
      private TextView txt,url;
      private DatabaseReference mDatabase;
  private ImageView img;
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_profile2);
  
          img=(ImageView)findViewById(R.id.userimg);
          mDatabase = FirebaseDatabase.getInstance().getReference().child("Users");
          mStorageRef = FirebaseStorage.getInstance().getReference().child("profile_images");
          sharedpreferences = getSharedPreferences(MyPREFERENCES, Context.MODE_PRIVATE);
          SharedPreferences.Editor editor = sharedpreferences.edit();
          String name = sharedpreferences.getString("name", null);
          editor.commit();
          txt = (TextView) findViewById(R.id.user);
          txt.setText(name);
  
  
          FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
          if (user != null) {
              // Name, email address, and profile photo Url
  
              Uri photoUrl = user.getPhotoUrl();
              Glide.with(this).load(photoUrl).into(img);
              String uid = user.getUid();
              //Picasso.with(context).load(photoUrl).into(img);
  
          }
      }
  
  
  }
  </code></pre>
  
  <p>Here is Xml        </p>
  
  <pre><code>&lt;ImageView
              android:layout_width="150dp"
              android:layout_height="150dp"
              android:layout_gravity="center_horizontal"
              android:layout_marginTop="45dp"
              android:id="@+id/userimg"
  
              /&gt;
  </code></pre>
  
  <p>here is how my firebase look</p>
  
  <pre><code>Users
  HzId4iQoBiZl4vcC2lcO7kHxFvx1
  Username: 
  "Humayun"
  image: 
  "https://firebasestorage.googleapis.com/v0/b/my-..."
  name: 
  "Being"
  </code></pre>
  
  <p>Here is log</p>
  
  <pre><code>08-07 23:53:02.980 990-990/com.example.ekene.blogzone D/ViewRootImpl@23bca1a[SettingsActivity]: ViewPostIme pointer 0
  08-07 23:53:03.032 990-990/com.example.ekene.blogzone D/ViewRootImpl@23bca1a[SettingsActivity]: ViewPostIme pointer 1
  08-07 23:53:03.053 990-1029/com.example.ekene.blogzone V/FA: Recording user engagement, ms: 7132
  08-07 23:53:03.054 990-1029/com.example.ekene.blogzone V/FA: Connecting to remote service
  08-07 23:53:03.059 990-1029/com.example.ekene.blogzone V/FA: Activity paused, time: 85858553
  08-07 23:53:03.061 990-1029/com.example.ekene.blogzone D/FA: Logging event (FE): user_engagement(_e), Bundle[{firebase_event_origin(_o)=auto, engagement_time_msec(_et)=7132, firebase_screen_class(_sc)=SettingsActivity, firebase_screen_id(_si)=779955923523228885}]
  08-07 23:53:03.074 990-990/com.example.ekene.blogzone V/FA: onActivityCreated
  08-07 23:53:03.074 990-1029/com.example.ekene.blogzone V/FA: Connection attempt already in progress
  08-07 23:53:03.222 990-1029/com.example.ekene.blogzone V/FA: Connection attempt already in progress
  08-07 23:53:03.223 990-1029/com.example.ekene.blogzone V/FA: Activity resumed, time: 85858723
  08-07 23:53:03.226 990-1029/com.example.ekene.blogzone D/FA: Logging event (FE): screen_view(_vs), Bundle[{firebase_event_origin(_o)=auto, firebase_previous_class(_pc)=SettingsActivity, firebase_previous_id(_pi)=779955923523228885, firebase_screen_class(_sc)=Profile, firebase_screen_id(_si)=779955923523228886}]
  08-07 23:53:03.230 990-990/com.example.ekene.blogzone D/ViewRootImpl@799292b[Profile]: setView = DecorView@a88d746[Profile] TM=true MM=false
  08-07 23:53:03.231 990-990/com.example.ekene.blogzone D/ViewRootImpl@23bca1a[SettingsActivity]: MSG_WINDOW_FOCUS_CHANGED 0
  08-07 23:53:03.237 990-1029/com.example.ekene.blogzone V/FA: Connection attempt already in progress
  08-07 23:53:03.241 990-990/com.example.ekene.blogzone D/ViewRootImpl@799292b[Profile]: dispatchAttachedToWindow
  08-07 23:53:03.253 990-990/com.example.ekene.blogzone V/Surface: sf_framedrop debug : 0x4f4c, game : false, logging : 0
  08-07 23:53:03.254 990-990/com.example.ekene.blogzone D/ViewRootImpl@799292b[Profile]: Relayout returned: old=[0,0][0,0] new=[0,0][1440,2960] result=0x7 surface={valid=true 503392329728} changed=true
  08-07 23:53:03.265 990-1103/com.example.ekene.blogzone D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, egl_color_buffer_format *, EGLBoolean) returns 0x3000,  [1440x2960]-format:1
  08-07 23:53:03.265 990-1103/com.example.ekene.blogzone D/OpenGLRenderer: eglCreateWindowSurface = 0x755a21ee00
  08-07 23:53:03.270 990-1029/com.example.ekene.blogzone D/FA: Connected to remote service
  08-07 23:53:03.270 990-1029/com.example.ekene.blogzone V/FA: Processing queued up service tasks: 4
  08-07 23:53:03.273 990-990/com.example.ekene.blogzone D/ViewRootImpl@799292b[Profile]: MSG_RESIZED_REPORT: frame=Rect(0, 0 - 1440, 2960) ci=Rect(0, 84 - 0, 168) vi=Rect(0, 84 - 0, 168) or=1
      MSG_WINDOW_FOCUS_CHANGED 1
  08-07 23:53:03.275 990-990/com.example.ekene.blogzone V/InputMethodManager: Starting input: tba=android.view.inputmethod.EditorInfo@509c45d nm : com.example.ekene.blogzone ic=null
  08-07 23:53:03.275 990-990/com.example.ekene.blogzone I/InputMethodManager: startInputInner - mService.startInputOrWindowGainedFocus
  08-07 23:53:03.341 990-1103/com.example.ekene.blogzone D/OpenGLRenderer: eglDestroySurface = 0x751db50540
  08-07 23:53:03.352 990-990/com.example.ekene.blogzone D/ViewRootImpl@23bca1a[SettingsActivity]: Relayout returned: old=[0,0][1440,2960] new=[0,0][1440,2960] result=0x5 surface={valid=false 0} changed=true
  </code></pre>
  
  <p>i am Beginner please help me with this code..it shows nothing in image view...how can i get Profile image of the user currently login.</p>