I'm getting data through PHP and set to listview.. First i open the application , the listview will show out, but after called finish and reopen the application , the listview will not appear and need to call refresh to make it re-appear ..
FeedAdapter:
public View getView(int position, View convertView, ViewGroup parent){
View row = inflater.inflate(R.layout.row_feed, parent, false);
TextView username = (TextView) row.findViewById(R.id.txtUsername);
MovieFeed moviefeed = localmovies.get(position);
username.setText(moviefeed.getUsername());
return row;
}
Tab1 fragment with listview
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.tab_1, container, false);
tweetListView = (ListView) v.findViewById(R.id.tweetList);
urlString = "http://idonno.net/G.php"; //json url
new ProcessJSON().execute(urlString);
tweetItemArrayAdapter = new FeedAdapter(getActivity(), localmovies);
tweetListView.setAdapter(tweetItemArrayAdapter);
return v;
}