Buggy code:
public class ActivityBackup extends ActionBarActivity { private Context context ; private boolean isReverseSort = false ; private Calendar dateFrom = Calendar . getInstance ( ) ; private Calendar dateTo = Calendar . getInstance ( ) ; private DatePicker datePickerFrom ; private DatePicker datePickerTo ; private AlertDialog alertDialog ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } private void initImportView ( ) { LinearLayout backupView = ( ( LinearLayout ) ( findViewById ( backup_list ) ) ) ; LayoutInflater layoutInflater = ( ( LayoutInflater ) ( getApplicationContext ( ) . getSystemService ( LAYOUT_INFLATER_SERVICE ) ) ) ; File [ ] backupFiles = Environment . getExternalStoragePublicDirectory ( DIRECTORY_DOWNLOADS ) . listFiles ( new FilenameFilter ( ) { @ Override public boolean accept ( File dir , String filename ) { return filename . startsWith ( getString ( backup_file_name ) ) ; } } ) ; ArrayList < BackupObject > backupObjects = new ArrayList < > ( ) ; for ( File backupFile : backupFiles ) { BackupObject backupObject = new BackupObject ( this ) ; if ( backupObject . init ( backupFile ) ) { backupObjects . add ( backupObject ) ; } } for ( final BackupObject backupObject : backupObjects ) { View backupListView = layoutInflater . inflate ( activity_backup_card , null ) ; TextView dateView = ( ( TextView ) ( backupListView . findViewById ( date ) ) ) ; TextView sizeView = ( ( TextView ) ( backupListView . findViewById ( size ) ) ) ; ImageButton deleteButton = ( ( ImageButton ) ( backupListView . findViewById ( action_delete ) ) ) ; backupListView . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { alertDialog = new AlertDialog . Builder ( context ) . setTitle ( action_import ) . setMessage ( dialog_description_are_you_sure ) . setPositiveButton ( dialog_ok , new DialogInterface . OnClickListener ( ) { @ Override public void onClick ( DialogInterface dialog , int which ) { alertDialog . dismiss ( ) ; final ProgressDialog progressDialog = ProgressDialog . show ( context , "" , getString ( progress_importing ) , true ) ; new Timer ( ) . schedule ( new TimerTask ( ) { @ Override public void run ( ) { backupObject . makeImport ( ) ; progressDialog . dismiss ( ) ; finish ( ) ; } <START_BUG> } , 1 ) ; <END_BUG> } } ) . setNegativeButton ( dialog_cancel , null ) . create ( ) ; alertDialog . show ( ) ; } } ) ; deleteButton . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { new AlertDialog . Builder ( context ) . setTitle ( R . string . action_delete ) . setMessage ( dialog_description_are_you_sure ) . setPositiveButton ( dialog_ok , new DialogInterface . OnClickListener ( ) { @ Override public void onClick ( DialogInterface dialog , int which ) { backupObject . delete ( ) ; initImportView ( ) ; } } ) . setNegativeButton ( dialog_cancel , null ) . create ( ) . show ( ) ; } } ) ; dateView . setText ( backupObject . getBackupDate ( ) . toString ( ) ) ; sizeView . setText ( ( ( backupObject . getBackupSize ( ) ) + "" ) ) ; backupView . addView ( backupListView ) ; } } private void initExportView ( ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } private void export ( ) { } }

Fix:
} , 10 ) ;