mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-29 13:53:54 +01:00
fix app Crash when tapping on the nearbyNotification (#4139)
* bugfix-#4086 -> implement CallBack interface in MainActivity centerMapToPlace() function * update previous commit * reformed the codechanges
This commit is contained in:
parent
7730112807
commit
86c571ceee
2 changed files with 21 additions and 1 deletions
|
|
@ -32,6 +32,7 @@ import fr.free.nrw.commons.navtab.NavTabLoggedOut;
|
|||
import fr.free.nrw.commons.nearby.NearbyNotificationCardView;
|
||||
import fr.free.nrw.commons.nearby.Place;
|
||||
import fr.free.nrw.commons.nearby.fragments.NearbyParentFragment;
|
||||
import fr.free.nrw.commons.nearby.fragments.NearbyParentFragment.NearbyParentFragmentInstanceReadyCallback;
|
||||
import fr.free.nrw.commons.notification.NotificationActivity;
|
||||
import fr.free.nrw.commons.notification.NotificationController;
|
||||
import fr.free.nrw.commons.quiz.QuizChecker;
|
||||
|
|
@ -298,7 +299,14 @@ public class MainActivity extends BaseActivity
|
|||
|
||||
public void centerMapToPlace(Place place) {
|
||||
setSelectedItemId(NavTab.NEARBY.code());
|
||||
nearbyParentFragment.centerMapToPlace(place);
|
||||
nearbyParentFragment.setNearbyParentFragmentInstanceReadyCallback(new NearbyParentFragmentInstanceReadyCallback() {
|
||||
// if mapBox initialize in nearbyParentFragment then MapReady() function called
|
||||
// so that nearbyParentFragemt.centerMaptoPlace(place) not throw any null pointer exception
|
||||
@Override
|
||||
public void onReady() {
|
||||
nearbyParentFragment.centerMapToPlace(place);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue