4 개의 탭이 있습니다. 하나의 탭 1 (응답) 나는 계속 버튼을 클릭하고 뒤로 버튼이있는 다른 페이지 (Respond1)로 이동해야한다고 다른 활동을 시작하고 싶습니다. 모든 것은 탭 1 자체에 있어야합니다. 나는 4 ~ 5 번 갈 때 흐름 오류에 스택을 쌓는 것처럼 문제가 있습니다.하나의 탭에 2 개의 활동이 있습니다.
Respond.Java
package com.muo.Livegroups;
import android.app.ActivityGroup;
import android.app.LocalActivityManager;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.util.Log;
public class Respond extends ActivityGroup
{
protected static LocalActivityManager mLocalActivityManager;
public static final String LOG_TAG = "muo";
@Override
/** Called when the activity is first created. */
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.respond);
//Continue button on Respond page
Button next1 = (Button) findViewById(R.id.Continue);
next1.setOnClickListener(new View.OnClickListener()
{
public void onClick(View view)
{
Intent myIntent = new Intent(view.getContext(), Respond1.class);
startActivityForResult(myIntent, 0);
// StringBuffer urlString = new StringBuffer();
// myIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
// replaceContentView("Respond1",myIntent);
int mInt=0;
Log.v(LOG_TAG, "mInt Value: " + mInt);
}
});
}
public void replaceContentView(String id, Intent newIntent)
{
View view = getLocalActivityManager()
.startActivity(id,newIntent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY))
.getDecorView();
this.setContentView(view);
}
}
Respond1.Java
package com.muo.Livegroups;
import android.app.ActivityGroup;
import android.app.LocalActivityManager;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
public class Respond1 extends ActivityGroup
{
protected static LocalActivityManager mLocalActivityManager;
public static final String LOG_TAG = "muo1";
/** Called when the activity is first created. */
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.respond1);
Button next = (Button) findViewById(R.id.Button03);
next.setOnClickListener(new View.OnClickListener()
{
public void onClick(View view)
{
Intent intent = new Intent();
setResult(RESULT_OK, intent);
finish();
// Intent myIntent = new Intent(view.getContext(), Respond.class);
// StringBuffer urlString = new StringBuffer();
// myIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
// replaceContentView("Respond",intent);
int mInt1=0;
Log.v(LOG_TAG, "mInt Value: " + mInt1);
}
});
}
public void replaceContentView(String id, Intent newIntent)
{
View view = getLocalActivityManager()
.startActivity(id,newIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP))
.getDecorView();
this.setContentView(view);
}
}
http://androidgenuine.com/ ActivityGroup의 예를 확인 ActivityGroup하고 새로운 활동을 시작하는이 코드를 삽입한다 –