Core layout / navigation issue for Android development

What is the best approach for navigating between windows in an Android app?

I say windows because I don't have the right terminology in java. I just began.

Suppose that the first screen the user sees is the username and password using the button. Upon successful login, does it show a completely new “window” with the corresponding registered information?

I tried putting 2 EditTexts and a button inside the view (using the graphic layout tab Main.xml [eclipse]) in main.xml, but didn't like it.

+3
source share
6 answers

"" Android.

XML- . B A..., :

// in activity A for the button click:

public void onButtonClick(View view) {
    Intent intent = new Intent(this, B.class);
    activity.startActivity(intent);
    activity.finish();
}






// in activity B you have:

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.B); //using your B.xml layout
}
+1

Android , Activity "", . startActivity().

2 xml, , , , - . ? -, , , mainfest, Android .

0

"" Android "", .

Intent intent = new Intent(GroupPickerActivity.this, SmsActivity.class);
startActivity(intent);
0

, , . "" ( android) .

The lab taught here from a college course at Cal Poly SLO, helped me quickly get to know Android.

0
source

Purpose of intention = new intention (this, otherclassname.class);

  intent.putExtra("userid", userfield);  //sends the userid

  startActivity(intent);

public void onCreate (Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);
    setContentView(R.layout.showhistoricweek);


    senduserid = getIntent().getIntExtra("userid", 0); //gets the userid
0
source

All Articles