Advertisement
Guest User

Untitled

a guest
Apr 11th, 2018
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. public class MainActivity extends AppCompatActivity {
  2.  
  3. Button b;
  4.  
  5. @SuppressLint("WrongViewCast")
  6. @Override
  7. protected void onCreate(Bundle savedInstanceState) {
  8. super.onCreate(savedInstanceState);
  9. setContentView(R.layout.activity_main);
  10.  
  11. b = findViewById(R.id.b);
  12.  
  13. b.setOnClickListener(new View.OnClickListener() {
  14. @Override
  15. public void onClick(View view) {
  16. Intent intent = new Intent(MainActivity.this, Browser.class);
  17. intent.putExtra("url", "https://www.google.com");
  18. startActivity(intent);
  19. }
  20. });
  21.  
  22. }
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement