I am doing an android project using php
,mysql
using xamp
server. I have retrieved the values into a ListView
from server database using json parser and displayed them successfully in activity1.
Now i need codings for, "when i press a button it should navigate into a new page named activity2 and the ListView
values in activity1 should display in new ListView
on activity2.
Thank you in advance.
in your starting intent you need to add data in intent :
Intent intent = new Intent(this, abc.class);
intent.putExtra("data", data);
startActivity(intent);
In your receiving intent you need to do:
Intent i = getIntent();
stock_list = i.getStringArrayListExtra("data");
The way you have it you've just created a new empty intent without any extras.
If you only have a single extra you can condense this down to:
stock_list = getIntent().getStringArrayListExtra("data");
</div>
Make a static function which contains the data for the list view and call the same function in the both activities. Hope it will solve you problem.