Return address on touch(android)
I'm trying to return the address of a certain location after touching the screen for over 1500 ms and ticking the button.
Yet, after adding the required code, the application crashes. The code for the buttons works, but not for retrieving the the address.
Could anyone help me with this?
Thank you!

	class Touch extends Overlay{
			@Override

			public boolean onTouchEvent(MotionEvent e, MapView m){
				if (e.getAction() == MotionEvent.ACTION_DOWN){
				start = e.getEventTime();
				x = (int) e.getX();
				y = (int) e.getY();
				TouchPoint = mapView.getProjection().fromPixels(x,y);
				
				
			}
			if (e.getAction() == MotionEvent.ACTION_UP){
				stop = e.getEventTime();
			}
			if(stop - start > 1500){
				AlertDialog alert = new AlertDialog.Builder(AndroidGoogleMaps.this).create();
				alert.setTitle("Pick an option");
				alert.setCancelable(true);
				alert.setButton(DialogInterface.BUTTON_POSITIVE, "Place a pinpoint.", new DialogInterface.OnClickListener() {
			           public void onClick(DialogInterface dialog, int id) {
			        	   dialog.cancel();
			           }
			       });
				alert.setButton(DialogInterface.BUTTON_NEUTRAL, "Address.", new DialogInterface.OnClickListener() {
			           public void onClick(DialogInterface dialog, int id) {
			        	  
			        	   try{
			        		   
								Geocoder geocoder = new Geocoder(getBaseContext(), Locale.getDefault());
								List<Address> address = geocoder.getFromLocation(TouchPoint.getLatitudeE6()/1000000 , TouchPoint.getLongitudeE6()/1000000 , 1);
								String display ="";
								if(address.size() > 0){
									
									for(int i = 0; i< address.get(0).getMaxAddressLineIndex(); i++){
								
										display += address.get(0).getAddressLine(i) + "\n";
											}
												Toast.makeText(getBaseContext(), display, Toast.LENGTH_LONG).show();
												
								}
							} catch (IOException e) {
									// TODO Auto-generated catch block
								e.printStackTrace();
			           }
			           }
			       	});
				alert.show();
				return true;
				}
			return false;
			}
	}

Return address on touch(android)
===

I'm trying to return the address of a certain location after touching the screen for over 1500 ms and ticking the button.
Yet, after adding the required code, the application crashes. The code for the buttons works, but not for retrieving the the address.
Could anyone help me with this?
Thank you!

	class Touch extends Overlay{
			@Override

			public boolean onTouchEvent(MotionEvent e, MapView m){
				if (e.getAction() == MotionEvent.ACTION_DOWN){
				start = e.getEventTime();
				x = (int) e.getX();
				y = (int) e.getY();
				TouchPoint = mapView.getProjection().fromPixels(x,y);
				
				
			}
			if (e.getAction() == MotionEvent.ACTION_UP){
				stop = e.getEventTime();
			}
			if(stop - start > 1500){
				AlertDialog alert = new AlertDialog.Builder(AndroidGoogleMaps.this).create();
				alert.setTitle("Pick an option");
				alert.setCancelable(true);
				alert.setButton(DialogInterface.BUTTON_POSITIVE, "Place a pinpoint.", new DialogInterface.OnClickListener() {
			           public void onClick(DialogInterface dialog, int id) {
			        	   dialog.cancel();
			           }
			       });
				alert.setButton(DialogInterface.BUTTON_NEUTRAL, "Address.", new DialogInterface.OnClickListener() {
			           public void onClick(DialogInterface dialog, int id) {
			        	  
			        	   try{
			        		   
								Geocoder geocoder = new Geocoder(getBaseContext(), Locale.getDefault());
								List<Address> address = geocoder.getFromLocation(TouchPoint.getLatitudeE6()/1000000 , TouchPoint.getLongitudeE6()/1000000 , 1);
								String display ="";
								if(address.size() > 0){
									
									for(int i = 0; i< address.get(0).getMaxAddressLineIndex(); i++){
								
										display += address.get(0).getAddressLine(i) + "\n";
											}
												Toast.makeText(getBaseContext(), display, Toast.LENGTH_LONG).show();
												
								}
							} catch (IOException e) {
									// TODO Auto-generated catch block
								e.printStackTrace();
			           }
			           }
			       	});
				alert.show();
				return true;
				}
			return false;
			}
	}
