Code example for SecureRandom

Methods: nextInt

0
		_context.startActivity(Intent.createChooser(sendIntent, "Title:"));
	} 
 
	private void SaveAsFile(String ErrorContent) {
		try { 
			SecureRandom generator = new SecureRandom();
			int random = generator.nextInt(99999);
			String FileName = "stack-" + random + ".stacktrace";
			FileOutputStream trace = CurContext.openFileOutput(FileName, Context.MODE_PRIVATE);
			trace.write(ErrorContent.getBytes());
			trace.close();
		} catch (Exception e) {
			// ... 
		} 
	} 
 
	private String[] GetErrorFileList() {
		File dir = new File(FilePath + "/");
		// Try to create the files folder if it doesn't exist 
		dir.mkdir();
		// Filter for ".stacktrace" files