I have an android program. It has a button which when clicked is supposed to open up a listview of various strings.
But the problem is, as soon as I click on the button, the listview opens up, but my original android program crashes. ( ListView is in another class which now begins to run).
public void onClick(View v) {
Intent intent = new Intent(v.getContext(), MemoryReader.class);
startActivityForResult(intent, 0);
}
This is the code snippet. What am I doing wrong?
Also, the thing I want is that I click on the button, a checkbox list opens up, I select various things and then come back to the original screen.
The idea I had right now was to implement a listview with checkboxes ( I read somewhere, this is possible) and then use the getAllCheckedOptions() function to retrieve whatever was checked.
IF there is a simpler way to tackle my problem, please point me to there.
Any help is much appreciated.
You are starting for a result without the possiblility to tell where the result is coming from. It is not good. Change 0 for smth else better.
Here are some pieces of my working code that calls an activity for result:
————————————- PackVideo activity ————————————–
calling for ServerSetActivity
constants setting and result catching:
(I have them together, because only here in catching both costants meet)
———————————– ServerSetActivity —————————————-
ending of the called activity
Put here “onCreate” and both layouts of MemoryReader, please.