Try Something like this,First you create tabcontext object in your TabActivity Class.like this
package com.loanreminder;
import android.app.TabActivity;
import android.os.Bundle;
/**
* @author Adil Soomro
*
*/
public class TabSample extends TabActivity {
/** Called when the activity is first created. */
public static TabSample tabContext;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.tabhost);
tabContext = this;
}
}
After Use this Object Like this in Your activity.
protected Dialog onCreateDialog(int id) {
switch(id){
case DATE_PICKER_INCORP:
return new DatePickerDialog(TabSample.tabContext, incorp_dateListener, incorp_year, incorp_month, incorp_day);
case DATE_PICKER_ESTB:
return new DatePickerDialog(TabSample.tabContext, estb_dateListener, estb_year, estb_month, estb_day);
}
return null;
}