title: How to add images from realtime database in every question?
body: <p>Question Model-</p>
  <pre><code>public class QuestionModel {
  
      private String Id;
      private String question;
      private String A;
      private String B;
      private String C;
      private String D;
      private String answer;
      private String link;
      private String set;
  
      public QuestionModel(String id, String question, String a, String b, String c, String d, String answer, String set, String link) {
          Id = id;
          this.question = question;
          A = a;
          B = b;
          C = c;
          D = d;
          this.answer = answer;
          this.set = set;
          this.link = link;
      }
  
      public String getId() {
          return Id;
      }
  
      public void setId(String id) {
          Id = id;
      }
  
      public String getQuestion() {
          return question;
      }
  
      public void setQuestion(String question) {
          this.question = question;
      }
  
      public String getA() {
          return A;
      }
  
      public void setA(String a) {
          A = a;
      }
  
      public String getB() {
          return B;
      }
  
      public void setB(String b) {
          B = b;
      }
  
      public String getC() {
          return C;
      }
  
      public void setC(String c) {
          C = c;
      }
  
      public String getD() {
          return D;
      }
  
      public void setD(String d) {
          D = d;
      }
  
      public String getAnswer() {
          return answer;
      }
  
      public void setAnswer(String answer) {
          this.answer = answer;
      }
  
      public String getSet() {
          return set;
      }
  
      public void setSet(String set) {
          this.set = set;
      }
  
      public String getLink() {
          return link;
      }
  
      public void setLink(String link) {
          this.link = link;
      }
  
  }
  </code></pre>
  <p>Question Activity -</p>
  <pre><code>    @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_question);
  
          Toolbar toolbar = findViewById(R.id.toolbar);
          broadcastReceiver = new ConnectionReceiver();    
          setSupportActionBar(toolbar);
  
          question = findViewById(R.id.question);
          noindicator = findViewById(R.id.no_indicator);
          bookmark1btn = findViewById(R.id.bookmark_btn1);
          optioncontainer = findViewById(R.id.options_containers);
          sharebtn = findViewById(R.id.share_btn);
          nextbtn = findViewById(R.id.next_btn);
  image =findViewById(R.id.imageView);
          preferences = getSharedPreferences(FILE_NAME, Context.MODE_PRIVATE);
          editor=preferences.edit();
          gson =new Gson();
          setId = getIntent().getStringExtra(&quot;setId&quot;);
  
          loadingDialog = new Dialog(this);
          loadingDialog.setContentView(R.layout.loading);
          loadingDialog.getWindow().setBackgroundDrawable(getDrawable(R.drawable.round_corner));
          loadingDialog.getWindow().setLayout(LinearLayout.LayoutParams.WRAP_CONTENT,LinearLayout.LayoutParams.WRAP_CONTENT);
          loadingDialog.setCancelable(false);
  
          list = new ArrayList&lt;&gt;();getBookmarks();
  
      bookmark1btn.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              if (modelmatch()){
                  bookmarksList.remove(matchedQuestionPosition);
                  bookmark1btn.setImageDrawable(getDrawable(R.drawable.bookmark_border));
              }else {
                  bookmarksList.add(list.get(position));
                  bookmark1btn.setImageDrawable(getDrawable(R.drawable.bookmark));
              }
          }
      });
  
      setId = getIntent().getStringExtra(&quot;setId&quot;);
  
      loadingDialog = new Dialog(this);
      loadingDialog.setContentView(R.layout.loading);
      loadingDialog.getWindow().setBackgroundDrawable(getDrawable(R.drawable.round_corner));
      loadingDialog.getWindow().setLayout(LinearLayout.LayoutParams.WRAP_CONTENT,LinearLayout.LayoutParams.WRAP_CONTENT);
      loadingDialog.setCancelable(false);
  
      list = new ArrayList&lt;&gt;();
  
      loadingDialog.show();
      myRef.child(&quot;SETS&quot;).child(setId).addListenerForSingleValueEvent(new ValueEventListener() {
              @Override
              public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
  
                                     String id = dataSnapshot1.getKey();
                  String question = dataSnapshot1.child(&quot;question&quot;).getValue().toString();
                  String a = dataSnapshot1.child(&quot;optionA&quot;).getValue().toString();
                  String b = dataSnapshot1.child(&quot;optionB&quot;).getValue().toString();
                  String c = dataSnapshot1.child(&quot;optionC&quot;).getValue().toString();
                  String d = dataSnapshot1.child(&quot;optionD&quot;).getValue().toString();
                  String correctANS = dataSnapshot1.child(&quot;correctAns&quot;).getValue().toString();
                  String link = dataSnapshot1.child(&quot;imageurl&quot;).getValue().toString();
                                        if(!link.equals(&quot;https://firebasestorage.googleapis.com/v0/b/bcs-bangla-c2aa0.appspot.com/o/line1.png?alt=media&amp;token=4ff22c6f-edd9-4571-844e-70612d066296&quot;))
  </code></pre>
  <p>{
  Picasso.get().load(link).into(image);</p>
  <p>}
  else
  {
  Picasso.get().load(<a href="https://firebasestorage.googleapis.com/v0/b/bcs-bangla-c2aa0.appspot.com/o/line1.png?alt=media&amp;token=4ff22c6f-edd9-4571-844e-70612d066296" rel="nofollow noreferrer">https://firebasestorage.googleapis.com/v0/b/bcs-bangla-c2aa0.appspot.com/o/line1.png?alt=media&amp;token=4ff22c6f-edd9-4571-844e-70612d066296</a>).into(image);</p>
  <p>}</p>
  <pre><code>                list.add(new QuestionModel(id,question,a,b,c,d,correctANS,setId,link));
              
                  }
                                 if (list.size() &gt; 0){
  
                  for (int i = 0; i &lt; 4; i++){
                      optioncontainer.getChildAt(i).setOnClickListener(new View.OnClickListener() {
                          @Override
                          public void onClick(View v) {
                              checkAnswer((Button)v);
                          }
                      });
                  }
  
                  playAmin(question,0,list.get(position).getQuestion());
  
                  nextbtn.setOnClickListener(new View.OnClickListener() {
                      @Override
                      public void onClick(View v) {
                          nextbtn.setEnabled(false);
                          nextbtn.setAlpha(0.7f);
                          enableoption(true);
                          position++;
                          if (position == list.size()){
                              ////score activity
                              if (interstitialAd.isLoaded()){
                                  interstitialAd.show();
                                  return;
                              }
  
                              Intent scoreIntent =new Intent(QuestionActivity.this,ScoreActivity.class);
                              scoreIntent.putExtra(&quot;score&quot;,score);
                              scoreIntent.putExtra(&quot;total&quot;,list.size());
                              startActivity(scoreIntent);
                              finish();
                              return;
                          }
                          count = 0;
                          playAmin(question,0,list.get(position).getQuestion());
                      }
                  });
  
                  sharebtn.setOnClickListener(new View.OnClickListener() {
                      @Override
                      public void onClick(View v) {
                          String body = list.get(position).getQuestion() + &quot;\n  (A) &quot; +
                                  list.get(position).getA() + &quot;\n  (B) &quot; +
                                  list.get(position).getB() + &quot;\n  (C) &quot; +
                                  list.get(position).getC() + &quot;\n  (D) &quot; +
                                  list.get(position).getD();
  
                          Intent shareaintent  = new Intent(Intent.ACTION_SEND);
                          shareaintent.setType(&quot;text/plain&quot;);
                          shareaintent.putExtra(Intent.EXTRA_SUBJECT, &quot;QUIZ CHALLANGE&quot;);
                          shareaintent.putExtra(Intent.EXTRA_TEXT, body);
                          startActivity(Intent.createChooser(shareaintent,&quot;share via&quot;));
  
  
                      }
                  });
  
              }else {
                  finish();
                  Toast.makeText(QuestionActivity.this,&quot;no question&quot;,Toast.LENGTH_SHORT).show();
              }
              loadingDialog.dismiss();
          }
  
          @Override
          public void onCancelled(@NonNull DatabaseError databaseError) {
              Toast.makeText(QuestionActivity.this,databaseError.getMessage(),Toast.LENGTH_SHORT).show();
              loadingDialog.dismiss();
              finish();
          }
      });
  
  
  }
  
  protected void onPause(){
      super.onPause();
      storebookmarks();
  }
  
  private void playAmin (final View view, final int Value, final String data){
  
      for (int i = 0; i &lt; 4; i++){
          optioncontainer.getChildAt(i).setBackgroundTintList(ColorStateList.valueOf(Color.parseColor(&quot;#FFCFFFD1&quot;)));
      }
  
      view.animate().alpha(Value).scaleX(Value).scaleY(Value).setDuration(500).setStartDelay(100)
              .setInterpolator(new DecelerateInterpolator()).setListener(new Animator.AnimatorListener() {
          @Override
          public void onAnimationStart(Animator animation) {
              if (Value == 0 &amp;&amp; count &lt; 4){
                  String option = &quot;&quot;;
                  if (count == 0){
                      option = list.get(position).getA();
                  }else if (count == 1){
                      option = list.get(position).getB();
                  }else if (count == 2){
                      option = list.get(position).getC();
                  }else if (count == 3){
                      option = list.get(position).getD();
                  }
                  playAmin(optioncontainer.getChildAt(count),0,option);
                  count++;
              }
  
          }
  
          @Override
          public void onAnimationEnd(Animator animation) {
              ////Data change
  
              if (Value == 0){
                  try {
                      ((TextView) view).setText(data);
                      noindicator.setText(position+1+&quot;/&quot;+list.size());
  
                      if (modelmatch()){
                          bookmark1btn.setImageDrawable(getDrawable(R.drawable.bookmark));
                      }else {
                          bookmark1btn.setImageDrawable(getDrawable(R.drawable.bookmark_border));
                      }
  
                  }catch (ClassCastException ex){
                      ((Button) view).setText(data);
                  }
                  view.setTag(data);
                  playAmin(view,1,data);
              }else {
                  enableoption(true);
              }
          }
  
          @Override
          public void onAnimationCancel(Animator animation) {
  
          }
  
          @Override
          public void onAnimationRepeat(Animator animation) {
  
          }
      });
  }
  
  private void checkAnswer(Button selectedOption){
      enableoption(false);
      nextbtn.setEnabled(true);
      nextbtn.setAlpha(1);
  
      if (selectedOption.getText().toString().equals(list.get(position).getAnswer())){
          ////correct ans
  
          score++;
          selectedOption.setBackgroundTintList(ColorStateList.valueOf(Color.parseColor(&quot;#4CAF50&quot;)));
          //Toast.makeText(QuestionActivity.this,score,Toast.LENGTH_SHORT).show();
      }else {
          ///incorrect ans
          selectedOption.setBackgroundTintList(ColorStateList.valueOf(Color.parseColor(&quot;#FF0000&quot;)));
          Button correctOption = (Button) optioncontainer.findViewWithTag(list.get(position).getAnswer());
          correctOption.setBackgroundTintList(ColorStateList.valueOf(Color.parseColor(&quot;#4CAF50&quot;)));
      }
  }
  
  private void enableoption(boolean enable){
      for (int i = 0;i &lt; 4;i++){
          optioncontainer.getChildAt(i).setEnabled(enable);
          if (enable){
              optioncontainer.getChildAt(i).setBackgroundTintList(ColorStateList.valueOf(Color.parseColor(&quot;#FFCFFFD1&quot;)));
  
          }
      }
  }
  
  private void getBookmarks(){
      String json= preferences.getString(KEY_NAME,&quot;&quot;);
  
      Type type = new TypeToken&lt;List&lt;QuestionModel&gt;&gt;(){}.getType();
  
      bookmarksList = gson.fromJson(json, type);
  
      if (bookmarksList == null){
          bookmarksList = new ArrayList&lt;&gt;();
      }
  }
  
  private boolean modelmatch(){
      boolean matched = false;
      int i = 0;
      for (QuestionModel model : bookmarksList){
  
          if (model.getQuestion().equals(list.get(position).getQuestion())
                  &amp;&amp; model.getAnswer().equals(list.get(position).getAnswer())
                  &amp;&amp; model.getSet().equals(list.get(position).getSet())){
              matched = true;
              matchedQuestionPosition = i;
          }
          i++;
      }
      return matched;
  }
  
  private void storebookmarks(){
      String json = gson.toJson(bookmarksList);
      editor.putString(KEY_NAME,json);
      editor.commit();
  }
  
  
  
  
  
  
  
  protected void registoreNetworkBroadcast(){
      if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.N){
          registerReceiver(broadcastReceiver,new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION));
      }
  
  }
  protected void unregistorNetwork(){
      try{
          unregisterReceiver(broadcastReceiver);
      }catch(IllegalArgumentException e){
          e.printStackTrace();
      }
  }
  
  @Override
  protected void onDestroy(){
      super.onDestroy();
      unregistorNetwork();
  }
  
  
  
  
  
  
  
  
  
  
  private void loadAds(){
      AdView mAdView = findViewById(R.id.adView);
      AdRequest adRequest = new AdRequest.Builder().build();
      mAdView.loadAd(adRequest);
  
      interstitialAd = new InterstitialAd(this);
      interstitialAd.setAdUnitId(getResources().getString(R.string.interstitialAd_id));
      interstitialAd.loadAd(new AdRequest.Builder().build());
  
      interstitialAd
              .setAdListener(new AdListener() {
                  @Override
                  public void onAdClosed() {
                      // Load the next interstitial.
                      interstitialAd.loadAd(new AdRequest.Builder().build());
  
                      Intent scoreIntent =new Intent(QuestionActivity.this,ScoreActivity.class);
                      scoreIntent.putExtra(&quot;score&quot;,score);
                      scoreIntent.putExtra(&quot;total&quot;,list.size());
                      startActivity(scoreIntent);
                      finish();
                      return;
                  }
  
              });
  }
  </code></pre>
  <p>}</p>
  <p>There are Question Activity of a quiz app. Here I want to show different image from firebase in every question for the quiz app. I have tried to show image.I have added imageurl in QuestionModel and tried to show using picasso library.But it did not worked.In every question same image shown although i have added different links of image(which i have stored in firebase storage and added the link in question in firebase) in firebase but with every question is shows the same image  . Please help  me to do this.</p>