android-developers
[Arriba] [Todas las Listas]

[android-developers] Escribiendo para archivar problema

To: Android Developers <android-developers@xxxxxxxxxxxxxxxx>
Subject: [android-developers] Escribiendo para archivar problema
From: leigh8347 <leigh8347@xxxxxxx>
Date: Sun, 30 Oct 2011 13:54:29 -0700 (PDT)
Delivery-date: Sun, 30 Oct 2011 16:54:45 -0400
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=x-beenthere:mime-version:date:user-agent:x-http-useragent :message-id:subject:from:to:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:x-google-group-id:list-post:list-help:list-archive:sender :list-subscribe:list-unsubscribe:content-type; bh=HhXp4M5YkIoQTb3FADvmggCjmxW61pBNyXpqQNDlicE=; b=Uo2VX1VBAzmePF7moMl/h0/ERNbwqiZCPeZZ5wzdAxQQBlwrkQM670aLqaeubMF3Kn gdvKJbPr+EMZCqJXJOronamh4gYDM3yrHIBiLew815vdQHoVWJDAbBIZ0x0JyqenWcUr ILYYEn6OQQuHiFQztwwDBC7pXtCpCOUz1zhQ0=
Envelope-to: traductor@xxxxxxxxxxx
List-archive: <http://groups.google.com/group/android-developers?hl=en_US>
List-help: <http://groups.google.com/support/?hl=en_US>, <mailto:android-developers+help@googlegroups.com>
List-id: <android-developers.googlegroups.com>
List-post: <http://groups.google.com/group/android-developers/post?hl=en_US>, <mailto:android-developers@googlegroups.com>
List-subscribe: <http://groups.google.com/group/android-developers/subscribe?hl=en_US>, <mailto:android-developers+subscribe@googlegroups.com>
List-unsubscribe: <http://groups.google.com/group/android-developers/subscribe?hl=en_US>, <mailto:android-developers+unsubscribe@googlegroups.com>
Mailing-list: list android-developers@xxxxxxxxxxxxxxxx; contact android-developers+owners@xxxxxxxxxxxxxxxx
Reply-to: android-developers@xxxxxxxxxxxxxxxx
Sender: android-developers@xxxxxxxxxxxxxxxx
User-agent: G2/1.0
hola

Puede cualquiera ayuda?

En mi *app *im intentando hacer el siguiente - Salvar 2 entradas de usuario a un .*txt
Archivo y salvarlo, entonces ser capaz de introducir 2 más entradas y salvar otra vez
y repetir mucho tiempo.

Tan lejos mi código crea un archivo, escribe las primeras 2 entradas y salva.
Pero cuándo *i prueba salvar #otro 2 lo justo reemplaza el primero. *im Bastante
confundido.

Aquí es lo que *i haber

	*txtData = (*EditText) *findViewById(*R.*id.Entrada1);
	*txtData2 = (*EditText) *findViewById(*R.*id.Entrada2);

	*btnWriteSDFile = (Botón) *findViewById(*R.*id.Salvar);
	unknown
hello

can anyone help?

on my app im trying to do the following - Save 2 user inputs to a .txt
file and save it, then be able to enter 2 more inputs and save again
and repeat many times.

so far my code creates a file, writes the first 2 inputs and saves.
but when i try saving another 2 it just replaces the first. im quite
confused.

here is what i have

	txtData = (EditText) findViewById(R.id.input1);
	txtData2 = (EditText) findViewById(R.id.input2);

	btnWriteSDFile = (Button) findViewById(R.id.save);
	btnWriteSDFile.setOnClickListener(new OnClickListener() {

	public void onClick(View v) {
		// write on SD card file data in the text box
		try {
			File myFile = new File(Environment.getExternalStorageDirectory(),
"parkrun_barcode.txt");
			myFile.createNewFile();
			FileOutputStream fOut = new FileOutputStream(myFile);
			OutputStreamWriter myOutWriter = new OutputStreamWriter(fOut);

			myOutWriter.append(txtData.getText() + ", " + txtData2.getText());
			myOutWriter.close();
			fOut.close();
			Toast.makeText(getBaseContext(),
					"Saved'",
					Toast.LENGTH_SHORT).show();
		} catch (Exception e) {
			Toast.makeText(getBaseContext(), e.getMessage(),
					Toast.LENGTH_SHORT).show();
		}

			txtData.setText("");
			txtData2.setText("");


	}
	});

	}

}

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@xxxxxxxxxxxxxxxx
To unsubscribe from this group, send email to
android-developers+unsubscribe@xxxxxxxxxxxxxxxx
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

<Anterior por Tema] Tema Actual [Siguiente por Tema>