Issue
Below is my code, but I dont get restaurant_id
,after reload activity;
Intent refresh = new Intent(getApplicationContext(), RestaurantDetailActivity.class);
refresh.putExtra("restaurant_id", mDataset.get(position).getRestaurantId());
startActivity(refresh);
finish();
Solution
Try the following steps...
Refresh
RestaurantDetailActivity
Intent intent = new Intent(RestaurantDetailActivity.this, RestaurantDetailActivity.class); Bundle bundle = new Bundle(); bundle.putInt("restaurant_id", mDataset.get(position).getRestaurantId()); intent.putExtras(bundle); startActivity(intent); RestaurantDetailActivity.this.finish();
In
OnCreate()
you should do like this in the same activityif(getIntent().getExtras() != null) { Bundle extras = getIntent().getExtras(); int restaurantId = extras.getInt("restaurant_id"); // todo with restaurantId }
Answered By - Silambarasan Poonguti
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.