- N€T0X|N: Talaria tuning: meg kéne tudni állni!
- D1Rect: Nagy "hülyétkapokazapróktól" topik
- Ismerkedés a Zyxel NSA325 v2-vel
- caprine: Snowrunner játék manuális tuning lehetőségei
- Luck Dragon: Óraátállítás
- Luck Dragon: Asszociációs játék. :)
- sziku69: Szólánc.
- Andras-G: Az internet veszélyei [2. rész] - Facebook Marketpalce
- Lalikiraly: Mercis kalandok - Huszonnyolcadik rész - Az újrakezdés
- sziku69: Fűzzük össze a szavakat :)
Új hozzászólás Aktív témák
-
automATIc
csendes tag
public class MainActivity extends AppCompatActivity {
EditText editText;
TextView textView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
editText = (EditText) findViewById(R.id.editText);
textView = (TextView) findViewById(R.id.textView);
textView.setVisibility(View.GONE);
}
public void writeMessage(View view){
String Message = editText.getText().toString();
String file_name = "user_data";
try {
FileOutputStream fileOutputStream = openFileOutput(file_name,MODE_PRIVATE);
fileOutputStream.write(Message.getBytes());
fileOutputStream.close();
Toast.makeText(getApplicationContext(),"Message saved",Toast.LENGTH_LONG).show();
editText.setText("");
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
public void readMessage(View view){
try {
String Message;
FileInputStream fileInputStream = openFileInput("user_data");
InputStreamReader inputStreamReader = new InputStreamReader(fileInputStream);
BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
StringBuffer stringBuffer = new StringBuffer();
while ((Message=bufferedReader.readLine())!=null)
{
stringBuffer.append(Message +"\n");
}
textView.setText(stringBuffer.toString());
textView.setVisibility(View.VISIBLE);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
public void showClick(View view){
if (view.getId() == R.id.showTextButton);
Intent sb = new Intent();
sb.setClass(this, ReadText.class);
startActivity(sb);
}
}Kb. itt tartok most. Azt szeretném, hogy az Activity mutassa a beírt szövegemet.
Egyelőre ezt az "adatbázist" tudtam kiCopyzni ami működik is
[ Módosította: Karma ]
Új hozzászólás Aktív témák
- Apple iPhone 15 Pro/ 128GB / Kártyafüggetlen /12Hó Garancia/ Akku: 88% / Gyári Garancia 2027.08.20ig
- GYÖNYÖRŰ iPhone SE 2022 128GB Red -1 ÉV GARANCIA - Kártyafüggetlen, MS4535, 100% AKKSI
- LG 34GS95UE - 34" Ívelt OLED / QHD 2K / 240Hz & 0.03ms / 1300 Nits / NVIDIA G-Sync / AMD FreeSync
- Apple iPhone 13 Mini 128GB,Újszerű,Adatkabel,12 hónap garanciával
- Eladó Dell Latitude 5340 i5-1345U 16 GB DDR5 Törésgarancia
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest

