Skip to content
Snippets Groups Projects
Commit a6f2862b authored by darshanxyz's avatar darshanxyz
Browse files

Removed Shared Preferences

parent aa953759
No related branches found
No related tags found
No related merge requests found
......@@ -11,6 +11,7 @@ import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.view.Window;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.EditText;
......@@ -99,6 +100,8 @@ public class RollNumber extends AppCompatActivity implements AdapterView.OnItemS
dialog.setMessage("Please Wait");
dialog.show();
adv.addChildEventListener(new ChildEventListener() {
@Override
public void onChildAdded(DataSnapshot dataSnapshot, String s) {
......@@ -110,20 +113,21 @@ public class RollNumber extends AppCompatActivity implements AdapterView.OnItemS
startActivity(new Intent(getApplicationContext(), TeacherActivity.class));
}
else {
SharedPreferences preferences = getSharedPreferences("ActivityPREF", Context.MODE_PRIVATE);
if(preferences.getBoolean("activity_executed", false)){
Intent intent = new Intent(RollNumber.this, MainActivity.class);
startActivity(intent);
finish();
// SharedPreferences preferences = getSharedPreferences("ActivityPREF", Context.MODE_PRIVATE);
//
// if(preferences.getBoolean("activity_executed", false)){
// Intent intent = new Intent(RollNumber.this, MainActivity.class);
// startActivity(intent);
// finish();
// dialog.hide();
// }
// else {
// SharedPreferences.Editor edit = preferences.edit();
// edit.putBoolean("activity_executed", true);
// edit.commit();
// }
dialog.hide();
}
else {
SharedPreferences.Editor edit = preferences.edit();
edit.putBoolean("activity_executed", true);
edit.commit();
}
}
}
@Override
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_login"
android:layout_width="match_parent"
......@@ -8,26 +9,31 @@
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.darshanbshah.odsystem.Login">
tools:context="com.darshanbshah.odsystem.Login"
android:background="@color/colorPrimary">
<com.google.android.gms.common.SignInButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/sign_in_button"
android:background="@color/colorPrimary"
app:buttonSize="wide"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="72dp"></com.google.android.gms.common.SignInButton>
<TextView
android:text="OD SYSTEM"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:id="@+id/textView3"
android:typeface="sans"
android:textAppearance="@style/TextAppearance.AppCompat"
android:textSize="36sp"
android:textAlignment="center"
android:textColor="@color/colorAccent"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true" />
<com.google.android.gms.common.SignInButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="186dp"
android:id="@+id/sign_in_button"
android:layout_centerHorizontal="true"></com.google.android.gms.common.SignInButton>
android:layout_alignParentStart="true"
android:layout_marginTop="114dp" />
</RelativeLayout>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment