-1

I'm new in android and trying to make an application that allows me to enter texts and once the button "Submit" is clicked it will send to another acitivty named "Receiver", and once the activity Receiver is open, it will display the texts I entered in edittext,

My problem is how can I get the row ID of the last entry I entered so it will be automatically displayed or without using textfield to manually get the row ID.

HERE IS MY CODE.

protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.project_main);

    try {
        String  s = "1";
        long l = Long.parseLong(s);
        DatabasePM amem = new DatabasePM(this);
        amem.open();
        String returnedName = amem.getNotif(l);
        amem.close();

        Dialog d  = new Dialog(this);
        d.setTitle("Notification!");
            TextView tv = new TextView(this);
            tv.setText(""+returnedName);
            d.setContentView(tv);
            d.show();
    }
Adrian Olar
  • 2,883
  • 4
  • 35
  • 63
sinlee
  • 45
  • 5

1 Answers1

0

I'm not sure what you're trying to achieve but Android provides a simple way to passing data across activities through Intent extra. I would suggest you take a look to this discussion.

Community
  • 1
  • 1
Thomas Bouron
  • 613
  • 3
  • 11