0

I have a simple searchview to perfom search functions and but I want when someone search something to finish the current activity where the searchview is placed and add and a Transition effect and then open the activity with the results. But I can't find a way to do it. Thank you :)

user3907002
  • 375
  • 1
  • 4
  • 17

2 Answers2

0

There's a pretty good starting guide here: http://developer.android.com/guide/topics/search/search-dialog.html. This one here is a bit more advanced: Implementing SearchView in action bar.

Community
  • 1
  • 1
Sasa Sekulic
  • 669
  • 4
  • 12
0

you can override the startActivty(Intent intent) method in your activity which has searchview.

@Override
public void startActivity(Intent intent) {
    finish();
    super.startActivity(intent);
    overridePendingTransition(R.anim.abc_slide_in_bottom, R.anim.abc_slide_out_top);
}

It worked for me. :)

vikoo
  • 2,451
  • 20
  • 27