Guest User

Untitled

a guest
May 5th, 2018
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.78 KB | None | 0 0
  1. application.getUserFromDatabase(getApplicationContext(), username, password);
  2.  
  3. public void getUserFromDatabase(Context context, String username, String password) {
  4. //new GetFromDatabase().execute("getUser.php", "?username=" + username + "&password=" + password, this, context);
  5. WelcomeActivity activity = new WelcomeActivity();
  6. activity.startMainActivity();
  7. }
  8.  
  9. <manifest xmlns:android="http://schemas.android.com/apk/res/android"
  10. package="org.mydomain.app">
  11.  
  12. <application
  13. android:name=".MainApplication"
  14. android:allowBackup="true"
  15. android:icon="@mipmap/ic_launcher"
  16. android:label="@string/app_name"
  17. android:roundIcon="@mipmap/ic_launcher_round"
  18. android:supportsRtl="true"
  19. android:theme="@style/AppTheme">
  20. <activity android:name=".MainActivity">
  21.  
  22. </activity>
  23. <activity android:name=".WelcomeActivity" >
  24. <intent-filter>
  25. <action android:name="android.intent.action.MAIN" />
  26.  
  27. <category android:name="android.intent.category.LAUNCHER" />
  28. </intent-filter>
  29. </activity>
  30. </application>
  31.  
  32. </manifest>
  33.  
  34. public void startMainActivity(){
  35. Intent startMain = new Intent(getApplicationContext(), MainActivity.class)
  36. startActivity(startMain);
  37. }
  38.  
  39. Intent intent = new Intent(this, WelcomeActivity.class);
  40. startActivtiy(intent);
  41.  
  42. WelcomeActivity activity = new WelcomeActivity();
  43.  
  44. Intent welcome = new Intent(context, WelcomeActivity.class);
  45. context.startActivtiy(welcome);
  46.  
  47. // FLAG_ACTIVITY_NEW_TASK is required
  48. // FLAG_ACTIVITY_CLEAR_TOP brings back to the top of the stack
  49. Intent mainActivity = new Intent(this, MainActivity.class);
  50. intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
  51. startActivity(mainActivity);
Add Comment
Please, Sign In to add comment