Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class NewThread extends AsyncTask<String, Void, String>{
- Document doc;
- @Override
- protected String doInBackground(String... params) {
- try{
- doc = Jsoup.connect("****************").get();
- content = doc.select(".entry-header");
- hello.clear();
- for(Element contents: content){
- hello.add(contents.text());
- }
- }catch (IOException e){
- e.printStackTrace();
- };
- return null;
- }@Override
- protected void onPostExecute(String result){
- list.setAdapter(adapter);
- }
- }
- CustomListAdapter adapter;
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_listik);
- getSupportActionBar().setDisplayShowHomeEnabled(true);
- getSupportActionBar().setLogo(R.drawable.logo_bar);
- getSupportActionBar().setDisplayUseLogoEnabled(true);
- dialog = new Dialog(Listik.this);
- dialog2 = new Dialog(Listik.this);
- dialog2.getWindow().setLayout(WindowManager.LayoutParams.FILL_PARENT, WindowManager.LayoutParams.FILL_PARENT);
- dialog2.setContentView(R.layout.cifra);
- dialog.getWindow().setLayout(WindowManager.LayoutParams.FILL_PARENT, WindowManager.LayoutParams.FILL_PARENT);
- dialog.setContentView(R.layout.quoteoftheday);
- list = (ListView)findViewById(R.id.list23);
- list.setOnItemClickListener(new AdapterView.OnItemClickListener() {
- @Override
- public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
- Toast toast = Toast.makeText(getApplicationContext(),position+"",Toast.LENGTH_LONG);
- toast.show();//примерно так надо будет получить все ссылки и дать им позицию.
- }
- });
- new NewThread().execute();
- adapter = new CustomListAdapter(this,hello,imgid);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement