Home starting a class with View parameter from onOptionsItemSelected
Reply: 0

starting a class with View parameter from onOptionsItemSelected

user985
1#
user985 Published in July 22, 2018, 8:34 am

i want to start a class with View parameter i cannot explain it well but here is my class

public void presentActivity(View view)
{
    ActivityOptionsCompat activityOptionsCompat = ActivityOptionsCompat.makeSceneTransitionAnimation
            (this,view,"transition");

    int revealX = (int) (view.getX() + view.getWidth() / 2);
    int revealY = (int) (view.getY() + view.getHeight()/ 2);

    Intent search = new Intent(this,search_activity.class);
    search.putExtra(search_activity.EXTRA_CIRCULAR_REVEAL_X,revealX);
    search.putExtra(search_activity.EXTRA_CIRCULAR_REVEAL_Y, revealY);

    ActivityCompat.startActivity(this, search, activityOptionsCompat.toBundle());
}

just i need to know how to start presentActivity from

 public boolean onOptionsItemSelected(MenuItem menuItem)
{
    return super.onOptionsItemSelected(menuItem);
}

please help me , really need a way to do this; thanks.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.311547 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO