0

Is it possible to open any acticity on the current tab by clicking the current tab itself?

What is to be done in my application:
user performs a search , a listactivity is displayed on same tab(Using TabGroup activity). Then If User presses the same tab, again the search page should open.

Is this possible?

Nanne
  • 64,065
  • 16
  • 119
  • 163
voidRy
  • 674
  • 9
  • 20
  • You don't need to add solved tags to your title, accept any answer that is correct by using the "check" mark next tot the answers. – Nanne Oct 18 '11 at 10:15

2 Answers2

0

Try this,,,,

Rather than starting two activities, you perform both in same activity.

  1. On pressing tab show search activity.
  2. show search screen, when user clicks search, get your search result and set it as current activity view i.e, setContentView(list);

when user clicks search again start SearchActivity again (as usual).

Noby
  • 6,562
  • 9
  • 40
  • 63
0

Refer this link:

Launching activities within a tab in Android

In first answer,you can set SharedPreference Variable and then check for that variable to know which activity to be loaded in this tab(in YourActivityGROUP class).you can set Extras to Intent accordingly in your main activity which you use to open an activity in a tab. (I haven't tried this,but i think,this will solve your problem.)

Community
  • 1
  • 1
Hiral Vadodaria
  • 19,158
  • 5
  • 39
  • 56