當我在firstActivity(MainActivity)
2個imageviews使圖像中的第一項活動invisble當我點擊簽到圖像,然後將其移動到SignUp Activity
... 這裏當我註冊圖像點擊然後再它會來MainActivity
..和在這裏,我不得不做出firstName
圖像隱形..如何從次活動導航到第一個活動
public class MainActivity extends Activity {
ImageView firstName,signIn ;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
firstName =(ImageView)findViewById(R.id.imageView1);
signIn =(ImageView)findViewById(R.id.imageView2);
signIn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent intent = new Intent(getApplicationContext(),SignUp.class);
startActivity(intent);
}
});
}
protected void onStart() {
super.onStart();
Log.i(TAG, "onStart");
String mm ="5";
Intent i= getIntent(); String s = i.getStringExtra("PrevAct");
if (mm ==s) {
firstName.setVisibility(View.GONE);
}
}
public class SignUp extends Activity {
ImageView signUp;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.signup);
signUp =(ImageView)findViewById(R.id.imageView3);
signUp.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent intent = new Intent(getApplicationContext(), MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
intent.putExtra("PrevAct","5");
startActivity(intent);
}
});
}}
Intent intent = new Intent(getApplicationContext(),MainActivity.class); \t \t \t \t intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); \t \t \t \t intent.putExtra(「PrevAct」,「5」); \t \t \t \t \t \t \t \t \t \t \t \t startActivity(意向); 保護無效onStart(){ \t \t super.onStart(); \t \t日誌。我(標籤,「onStart」); \t \t \t \t \t 字符串\t毫米= 「5」; \t \t Intent i = getIntent(); String s = i.getStringExtra(「PrevAct」); \t \t \t 如果\t(毫米== S){ \t \t \t \t \t \t \t \t \t loginWith.setVisibility(View.GONE); \t \t \t signIn.setVisibility(View.GONE); \t \t} \t \t \t \t \t} – user1862322
感謝reply..i已經chaged喜歡的但不能getting..in mainactivity我把代碼中的onStop()... – user1862322