Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. public class MainActivity extends AppCompatActivity {
  2.  
  3. String CUSTOM_ACTION = "com.text.test";
  4.  
  5. @Override
  6. protected void onCreate(Bundle savedInstanceState) {
  7. super.onCreate(savedInstanceState);
  8. setContentView(R.layout.activity_main);
  9.  
  10. TextView txv = (TextView) findViewById(R.id.txv);
  11. txv.setOnClickListener(new View.OnClickListener() {
  12. @Override
  13. public void onClick(View view) {
  14. // Intent i = new Intent(MainActivity.this,Main2Activity.class);
  15. Intent i = new Intent();
  16. i.setAction(Intent.ACTION_CALL_BUTTON);
  17. i.setAction("com.text.test");
  18.  
  19. startActivity(i);
  20. }
  21. });
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement