Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2014
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. public void addWebAction(TableLayout table){
  2. TableRow rowWeb = new TableRow(this);
  3.  
  4. TextView tvWeb = new TextView(this);
  5. tvWeb.setTextSize(18);
  6. tvWeb.setPadding(0, 10, 0, 0);
  7. tvWeb.setText(contact.getWeb());
  8. rowWeb.addView(tvWeb);
  9.  
  10. ImageButton ibWeb = new ImageButton(this);
  11. ibWeb.setBackgroundColor(Color.TRANSPARENT);
  12. ibWeb.setImageResource(R.drawable.ic_action_search);
  13. ibWeb.setOnClickListener(new View.OnClickListener() {
  14. @Override
  15. public void onClick(View v) {
  16. Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(contact.getWeb()));
  17. startActivity(browserIntent);
  18. }
  19. });
  20. rowWeb.addView(ibWeb);
  21. table.addView(rowWeb);
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement