Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- application.getUserFromDatabase(getApplicationContext(), username, password);
- public void getUserFromDatabase(Context context, String username, String password) {
- //new GetFromDatabase().execute("getUser.php", "?username=" + username + "&password=" + password, this, context);
- WelcomeActivity activity = new WelcomeActivity();
- activity.startMainActivity();
- }
- <manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="org.mydomain.app">
- <application
- android:name=".MainApplication"
- android:allowBackup="true"
- android:icon="@mipmap/ic_launcher"
- android:label="@string/app_name"
- android:roundIcon="@mipmap/ic_launcher_round"
- android:supportsRtl="true"
- android:theme="@style/AppTheme">
- <activity android:name=".MainActivity">
- </activity>
- <activity android:name=".WelcomeActivity" >
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- </application>
- </manifest>
- public void startMainActivity(){
- Intent startMain = new Intent(getApplicationContext(), MainActivity.class)
- startActivity(startMain);
- }
- Intent intent = new Intent(this, WelcomeActivity.class);
- startActivtiy(intent);
- WelcomeActivity activity = new WelcomeActivity();
- Intent welcome = new Intent(context, WelcomeActivity.class);
- context.startActivtiy(welcome);
- // FLAG_ACTIVITY_NEW_TASK is required
- // FLAG_ACTIVITY_CLEAR_TOP brings back to the top of the stack
- Intent mainActivity = new Intent(this, MainActivity.class);
- intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
- startActivity(mainActivity);
Add Comment
Please, Sign In to add comment