title: how to refresh activity from adapter when a record is deleted?
body: <p>i am using android studio in listview i have added adapter. when user click delete button from listview item then i want to refresh activity.</p>
  
  <p>adapter delete button definition </p>
  
  <pre><code>    deletebtn =convertView.findViewById(R.id.delete_btn);
  
      deletebtn.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View view) {
  
          databaseAccess.deleteFavorite(favoriteModel.getWid());
  
          }
      });
  </code></pre>
  
  <p>i have tried this code but not working</p>
  
  <pre><code>   deletebtn =convertView.findViewById(R.id.delete_btn);
  
      deletebtn.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View view) {
  
          databaseAccess.deleteFavorite(favoriteModel.getWid());
  
  
              Intent intent1=new Intent(context,FavoriteNameslist.class);
  
              context.startActivity(intent1);
              ((Activity)context).finish();
  
          }
      });
  </code></pre>
  
  <p>i am new to Android - please help<br>
  i want when user click on delete button then refresh activity</p>