1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
String notes;
@Override
public void onCreate (Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Intent i_retrieve = getIntent();
notes = i_retrieve.getStringExtra("notes");
ShowList();
addListenerOnButton();
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
public void ShowList ()
{
ListView lv = (ListView) findViewById(R.id.list_messages);
ArrayList<String> strArr = new ArrayList<>();
strArr.add(notes);
ArrayAdapter<String> adapter = new ArrayAdapter<>(getApplicationContext(), R.layout.row, strArr);
lv.setAdapter(adapter);
adapter.notifyDataSetChanged();
Toast.makeText(this, "" + notes, Toast.LENGTH_LONG).show();
} |
Partager