-1

タブホストに が含まれています4 activities

1===>>show my appointments

2===>>set Appointment 

3===>>Block calender

4===>>other.

1.I need to launch the set appointment from the show my appointment by passing some data (but tabhost should be remains)

2. From the dash board if want to open set appointment in tabhost but internally its executing all activities in tabhost how can I avoid this if I am coming from the dash board to tabhost.

私はtabHost.setCurrentTab(SetAppointment );

しかし、内部的には他のアクティビティも実行していますが、それは起こるべきではありません。

  public class ShowMyAppointments extends Activity implements OnClickListener
  {

 //     in list selection  the below code

  else if(showItems[selectedPosition].equals("ReSchedule")){

                                String appointmentId = String.valueOf(appointmentsList.get(SELECTED_PATIENT).getId());
                                String statusCode = Constants.STATUS_CANCLEED_DOCTOR;               

                                new SatusAsunc(ShowMyAppointments.this ,appointmentId , statusCode).execute();  

                                HomeGridViewActivity.value=1;                        
                                Constants.CONSUMER_ID=appointmentsList.get(SELECTED_PATIENT).getConsumerID();                        
                                Constants.CONTACT_NO=appointmentsList.get(SELECTED_PATIENT).getConsumerContact();
                                Constants.PATIENT_NAME=appointmentsList.get(SELECTED_PATIENT).getConsumerName();                    
                                Intent intent = new Intent(ShowMyAppointments.this , BaseActivity.class);                    
                                startActivity(intent);
                            }
4

1 に答える 1

0

これらの 2 つのメソッドを、show my meetings アクティビティから呼び出してセット アポイントメント アクティビティに呼び出してください。

 TabActivity _parentActivity=(TabActivity) getParent();
_parentActivity.getTabHost().setCurrentTab(1); //index of set appointments
        _parentActivity.onTabChanged("set appointment");   //Please provide tabSpaceName here  of set appointment name

意図的にデータを送信したい場合は、これを試してください

Intent intent=new Intent();
        intent.putExtra(name, value);
    _parentActivity.startActivityFromChild(childActivity, intent, requestCode);  //childActivity =show my appointment   requestCode=0  or any thing else
于 2012-08-13T06:57:52.420 に答える