working login method

This commit is contained in:
Page Asgardius 2022-09-30 09:32:14 -07:00
parent 8cb3a5248b
commit d4f7160dc4
2 changed files with 11 additions and 0 deletions

View file

@ -144,6 +144,7 @@ public class MainActivity extends AppCompatActivity {
private void mainScreen (String username) { private void mainScreen (String username) {
Intent intent = new Intent(this, MainScreen.class); Intent intent = new Intent(this, MainScreen.class);
intent.putExtra("username", username);
startActivity(intent); startActivity(intent);
} }

View file

@ -2,13 +2,23 @@ package asgardius.page.r3forumtest;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
public class MainScreen extends AppCompatActivity { public class MainScreen extends AppCompatActivity {
String username;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main_screen); setContentView(R.layout.activity_main_screen);
username = getIntent().getStringExtra("username");
}
public void onBackPressed(){
Intent a = new Intent(Intent.ACTION_MAIN);
a.addCategory(Intent.CATEGORY_HOME);
a.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(a);
} }
} }