hi,
i am getting error java.lang.stackoverflow

Question
-----------

Activity  A (Contains 2 Tab - select second one) --> Activity  B (contain 
one button - when i clicked on button) --> Activity C ((contain one button 
- when i clicked on button @ that time i want to go back to the Activity B)

the above flow is work fine.

but,

Problem
-----------

Activity  A (Contains 2 Tab - select second one) --> Activity  B (contain 
one button - when i clicked on button) --> Activity C ((contain one button 
- when i clicked on button @ that time i want to go back to the Activity B) 

Now again i want to go for Activity C after pressing a button which is 
available in activity B @  that time i am getting Error 
java.lang.StackOverflowError

how can i resolve it ?


here i am putting my code
---------------------------------
==========================================================================================
 
public class A extends TabActivity
{
@Override
protected void onCreate(Bundle savedInstanceState) 
{
super.onCreate(savedInstanceState);
setContentView(R.layout.adspace_tab_controller);
 final TabHost tabhost=getTabHost();

        
tabhost.addTab(tabhost.newTabSpec("tab1").setIndicator("tab1").setContent(new 
Intent(this, B1.class)));

        
tabhost.addTab(tabhost.newTabSpec("tab2").setIndicator("tab2").setContent(new 
Intent(this, B2.class)));
}
}

==========================================================================================
 

public class B1 extends ActivityGroup implements OnClickListener
{
private ImageView iv=null;
@Override
protected void onCreate(Bundle savedInstanceState) 
{
super.onCreate(savedInstanceState);
setContentView(R.layout.proposal_list);
iv=(ImageView)findViewById(R.id.iv);
proposalSearch.setOnClickListener(this);
 }
public void onClick(View v) 
{
if(v==iv)
{
Intent intent = new Intent(v.getContext(), C.class);
replaceContentView("C", intent);
}
}
public void replaceContentView(String id, Intent newIntent) 
{
View view = 
getLocalActivityManager().startActivity(id,newIntent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT))
 
.getDecorView();
this.setContentView(view);
}     
}

==========================================================================================
 

public class C extends ActivityGroup implements OnClickListener
{
private Button goback;
@Override
protected void onCreate(Bundle savedInstanceState) 
{
super.onCreate(savedInstanceState);
setContentView(R.layout.proposal_search);
 goback =(Button)findViewById(R.id. goback );
 goback .setOnClickListener(this);
}
public void onClick(View v) 
{
if(v== goback )
{
Intent intent = new Intent(v.getContext(), B1.class);
replaceContentView("B1", intent);
}
}
public void replaceContentView(String id, Intent newIntent) 
{
View view = 
getLocalActivityManager().startActivity(id,newIntent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT))
 
.getDecorView();
this.setContentView(view);
}  
}
==========================================================================================

please help me i didn't understand what can i do.
thank you.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to