Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rowLink=(TableLayout)getLayoutInflater().inflate(R.layout.details, null);
- linearlayout.addView(rowLink);
- ((ViewGroup)rowLink.getParent()).removeView(rowLink);
- //at this line i got an exception i.e
- //Method invocation '((ViewGroup) rowLink.getParent()).removeAllViews()' may produce
- //'java.lang.NullPointerException'
- tvrgp=(TextView)rowLink.findViewById(R.id.tvrgp);
- tvrg=(TextView)rowLink.findViewById(R.id.tvrg);
- tvra=(TextView)rowLink.findViewById(R.id.tvra);
- tvrp=(TextView)rowLink.findViewById(R.id.tvrp);
- tvrplusminus=(TextView)rowLink.findViewById(R.id.tvrplusminus);
- tvrpim=(TextView)rowLink.findViewById(R.id.tvrpim);
- try{
- Document doc = Jsoup.connect(temp).get(); //temp is url of webiste
- Element regularseason = doc.getElementsByTag("table").get(3);
- Elements tbody=regularseason.select("tbody");
- Elements row = tbody.select("tr");
- Element vrgp = row.select("td").get(1);
- Element vrg = row.select("td").get(2);
- Element vra = row.select("td").get(3);
- Element vrp = row.select("td").get(4);
- Element vrplusminus=row.select("td").get(5);
- Element vrpim = row.select("td").get(6);
- tvrgp.setText(vrgp.text().trim());
- tvrg.setText(vrg.text().trim());
- tvra.setText(vra.text().trim());
- tvrp.setText(vrp.text().trim());
- tvrplusminus.setText(vrplusminus.text().trim());
- tvrpim.setText(vrpim.text().trim());
- }catch(Exception ex)
- { ex.printStackTrace();}
- new AlertDialog.Builder(LineUps.this)
- .setTitle("player")
- .setView(rowLink)
- .setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int which) {
- }
- }).show();
- if((ViewGroup)rowLink.getParent() != null){
- ((ViewGroup)rowLink.getParent()).removeView(rowLink);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement