android - how can i get a reference to the top level view to set an onTouch event? -


Can you please help me or give me an example of this code, Need to set touch listener when activity gets touched then a new activity will start? Just do not know how to do this and want to see the code so that I can do my work

Thank you very much

your layout.xml 'RootView'. Then your onCreate () You can get this view by calling activity in the method:

  See root = seeById (R.id .RootView);   

And then you can set your OnTouchListener These are:

  root.setOnTouchListener (New On-TouchListener) {@Override public boolean onTouch (see V, Motion Event Event) {startActivity (New Intent (Current Activity., MyNewActivity.class ); // True, the use of the event was malfunctioning;}});    

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -