How to manage multiples activities under a single tab of TabActivity

前端 未结 3 1746
礼貌的吻别
礼貌的吻别 2020-12-29 16:43

Here\'s the problem. In my app, I have 5 tabs which contains activities. In each of them, I have to show differents screens. For example, the main activity of a tab is a lis

3条回答
  •  天涯浪人
    2020-12-29 17:21

    Ok, the solution (given on the site above), was this :

    this.m_backButton.setOnClickListener(new OnClickListener() { 
      @Override 
      public void onClick(View v) {
      Intent intent = new Intent(v.getContext(), Activity1.class);
      Activity1 parentActivity = (Activity1)getParent();  
      parentActivity.replaceContentView("activity1", intent, 
                     Intent.FLAG_ACTIVITY_REORDER_TO_FRONT ); 
      }
    });
    

    and take out my main activitity from ActivityGroup. You can see the answer here : http://gamma-point.com/content/android-how-have-multiple-activities-under-single-tab-tabactivity#comment-4

提交回复
热议问题