startActivityForResult is deprecated in Java

Viewed 35

I've been trying to do a list view in android. I tried to add a feature where when you press an item, it will send you to an edit page, letting you edit the parameters of the item. To do so, I used an Intent. I tried:

@Override
            public void onItemClick(AdapterView<?> adapterView, View view, int pos, long l)
            {
                lastSel = missionAdapter.getItem(pos);
                Intent intent = new Intent(MainActivity.this, EditActivity.class);
                intent.putExtra("name", lastSel.getName());
                intent.putExtra("desc", lastSel.getDesc());
                intent.putExtra("done", lastSel.getDone());
                startActivityForResult(intent, 0);
            }

But for some reason there's a line on the startActivityForResult... And when I try to click an item, the app crashes. Probably because of that. I searched and found out this method has been deprecated.

How do I solve it?

0 Answers
Related