protected override void OnCreate(Android.OS.Bundle bundle)
{
base.OnCreate(bundle);
SetContentView(Resource.Layout.Main);
Button save = (Button)FindViewById(Resource.Id.Save);
save.Click += new System.EventHandler(save_Click);
nome = (EditText)FindViewById(Resource.Id.Nome);
numero_domicilio = (EditText)FindViewById(Resource.Id.numero_domicilio);
data_nasci = (EditText)FindViewById(Resource.Id.data_nasci);
data_morte = (EditText)FindViewById(Resource.Id.data_morte);
masculina = (CheckBox)FindViewById(Resource.Id.Masculino);
feminina = (CheckBox)FindViewById(Resource.Id.Feminino);
escolaridade = (EditText)FindViewById(Resource.Id.Escolaridade);
estuda_altuamento = (CheckBox)FindViewById(Resource.Id.estuda_altuamento);
}
private void save_Click(object sender, System.EventArgs e)
{
File my = new File("my.txt");
try
{
my.CreateNewFile();
} catch
{
}
try
{
BufferedWriter rite = new BufferedWriter(new FileWriter(my, true));
rite.Write(nome.ToString());
rite.Flush();
rite.Close();
} catch
{
}
}
};
}
Loading
Chintan RathodPosted May 22, 2012, 8:36 AM
In android, while you are accessing external sdcard, you need to define permission in "android.manifest" file.
Just open your "android.manifest" file, and add following code before
code:
This will tell application to access external storage.
Thanks & Regards
-----------------
Chintan Rathod