Android 4 crash fix

This commit is contained in:
GaidamakUA 2015-11-09 11:36:10 +02:00
parent 0568b0abb0
commit 9752081bc8
2 changed files with 7 additions and 4 deletions

View file

@ -254,7 +254,6 @@ public class EditPoiDialogFragment extends DialogFragment {
@Override
public void onClick(View v) {
save();
}
});
Button cancelButton = (Button) view.findViewById(R.id.cancelButton);
@ -570,7 +569,6 @@ public class EditPoiDialogFragment extends DialogFragment {
}
}
// TODO: 8/28/15 Move to helper
public static class ShowDeleteDialogAsyncTask extends AsyncTask<Amenity, Void, Node> {
private final OpenstreetmapUtil openstreetmapUtil;
private final AppCompatActivity activity;

View file

@ -22,12 +22,17 @@ import net.osmand.plus.osmedit.OsmPoint;
public class DeletePoiDialogFragment extends DialogFragment {
private static final String KEY_AMENITY_NODE = "amenity_node";
Activity activity;
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
this.activity = activity;
}
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
final Activity activity = getActivity();
OsmEditingPlugin plugin = OsmandPlugin.getPlugin(OsmEditingPlugin.class);
final OpenstreetmapUtil mOpenstreetmapUtil;
mOpenstreetmapUtil = new OpenstreetmapLocalUtil(plugin, activity);