android-developers
[Arriba] [Todas las Listas]

[android-developers] Re: Escribiendo para archivar problema

To: Android Developers <android-developers@xxxxxxxxxxxxxxxx>
Subject: [android-developers] Re: Escribiendo para archivar problema
From: Belvedere Computer Services <fa8298b8@xxxxxxxxx>
Date: Sun, 30 Oct 2011 21:35:43 -0700 (PDT)
Delivery-date: Mon, 31 Oct 2011 13:49:44 -0400
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=x-beenthere:mime-version:date:in-reply-to:references:user-agent :x-http-useragent:message-id:subject:from:to:x-original-sender :reply-to:precedence:mailing-list:list-id:x-google-group-id :list-post:list-help:list-archive:sender:list-subscribe :list-unsubscribe:content-type:content-transfer-encoding; bh=TlhHKyMDG3X3DZArA9K24/s7pAGctVnEokk5XhlEPNI=; b=EvPtyo+Qqwh8/15ZjHvNfYVpPQwGm7F9dDCbOdXruh+xd8cSArfXbs1RxrPKyt8plf mKfqpsQ7xOJv1LwJJCz6xRoakgOKJP1HDkk+CZ5BA/0nvYdYvol5rZaQDWitj41D5GYR pEu3wawQ2AC364uj/KpnEVTlRGowmlqg7uvuM=
Envelope-to: traductor@xxxxxxxxxxx
In-reply-to: <9069664c-beab-41c1-a002-5df6003e1bb2@x20g2000vbl.googlegroups.com>
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
References: <9069664c-beab-41c1-a002-5df6003e1bb2@x20g2000vbl.googlegroups.com>
Reply-to: android-developers@xxxxxxxxxxxxxxxx
Sender: android-developers@xxxxxxxxxxxxxxxx
User-agent: G2/1.0
*i No ha tenido una posibilidad de correr en *ADK todavía para probar pero en cada *JDK he visto uno necesita llamar .*flush() Entonces es como *commonsguy
explica

En *Oct 30, 3:54 *pm, *leigh8347 <*leigh8...@xxxxxxx> escribió:
> 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 Adj
i have not had a chance to run on ADK yet to test but in every JDK I
have seen one needs to call .flush() then it is like commonsguy
explains

On Oct 30, 3:54 pm, leigh8347 <leigh8...@xxxxxxx> wrote:
> 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>