Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MainActivity2.class
- ArrayList<String> listItems;
- ArrayAdapter<String> adapter;
- listView = (ListView)findViewById(R.id.listView);
- listItems=new ArrayList<String>();
- AsyncGetNews getnewstask = new AsyncGetNews();
- getnewstask.execute();
- adapter.notifyDataSetChanged();
- listView.setAdapter(adapter);
- private class AsyncGetNews extends AsyncTask<String,Void,Void> {
- @Override
- protected Void doInBackground(String... params) {
- SoapReq so = new SoapReq();
- Helper hp = new Helper();
- String[] temp = so.getLatestNews();
- adapter = new ArrayAdapter<String>(MainActivity2.this, R.layout.simple_list_item_1, listItems);
- for (String s : temp)
- listItems.add(s);
- return null;
- }
- }
Add Comment
Please, Sign In to add comment