Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

Reload activity with receiving new data with intent

Below is my code;

Below is my code when click on recyclerview item;

 holder.mainView.setOnClickListener(v -> {

 Intent intent = new Intent(RestaurantDetailActivity.this, RestaurantDetailActivity.class);
 Bundle bundle = new Bundle();
 bundle.putString("restaurant_id", mDataset.get(position).getRestaurantId());
 intent.putExtras(bundle);
 startActivity(intent);
 RestaurantDetailActivity.this.finish();
 });

Below is my code when receiving my data while calling onCreate() ;

 Bundle bundle = getIntent().getExtras();

    if (bundle != null) {
        restaurant_id = bundle.getString("restaurant_id");
    } else {
        Log.e("d", "IS NULL !");
    }

I am getting restaurant_id null everytime...

How can I reload same activity by getting new restaurant_id and load whole screen with reference to particular restaurant_id

Plz help guys

Comments