Question: I'm setting up a website using Google Sites.

If I add a hyperlink to a page and select 'Web Address', then enter `http://www.example.com` as the link, the actual page ends up being rendered with

```
http://www.google.com/url?q=http://www.example.com

```

as the hyperlink address. This injects an annoying 'redirecting you to www.example.com' Google page and a two-second delay into following hyperlinks off my page.

Is there any way to turn this behaviour off?

Answer: 
The gallery is using Android's media database to display the list of media. Deleting the file will not be reflected in the database until it scans the filesystem again. That is for example done after rebooting.

You can either delete the file directly through the database or force it to scan the file or folder you just deleted.

```
File fileToDelete =  new File("filepath");
boolean fileDeleted =  fileToDelete.delete();

// request scan    
Intent scanIntent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
scanIntent.setData(Uri.fromFile(fileToDelete));
sendBroadcast(scanIntent);

```
It is to do with how Gallery shows the Image files. Image file's Thumbnails are cached in the MediaStore and all the details are present in the Mediastore contentProvider. 

Deleting the file will not update this database. But when you restart the emulator, Mediascanning is done by android. If MediaScanning can be triggered , gallery will stop showing the files