Skip to content

Commit 16305d4

Browse files
committed
fixed crashes
1 parent 6179c62 commit 16305d4

3 files changed

Lines changed: 23 additions & 23 deletions

File tree

app/src/main/java/com/cmput301f17t11/cupofjava/Views/HabitEventTimeLineActivity.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ public class HabitEventTimeLineActivity extends Fragment {
5656
private ListView listView;
5757
private TextView textView;
5858
private Button viewMap;
59-
private double currentLat; //latitude of current loc
60-
private double currentLon; //Longitude of current loc
59+
//private double currentLat; //latitude of current loc
60+
//private double currentLon; //Longitude of current loc
6161

6262

6363
ArrayList<HabitEvent> events = new ArrayList<>();
@@ -91,12 +91,12 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
9191
Bundle bundle = getArguments();
9292
if (bundle != null) {
9393
this.userName = bundle.getString("userName");
94-
this.currentLat = bundle.getDouble("currentLat");
95-
this.currentLon = bundle.getDouble("currentLon");
94+
//this.currentLat = bundle.getDouble("currentLat");
95+
//this.currentLon = bundle.getDouble("currentLon");
9696

9797
Log.i("HabitEventTimelineFragment: Username received: ", userName);
98-
Log.i("HabitEventTimelineFragment: Latitude received: ", ""+currentLat+"");
99-
Log.i("HabitEventTimelineFragment: Latitude received: ", ""+currentLon+"");
98+
//Log.i("HabitEventTimelineFragment: Latitude received: ", ""+currentLat+"");
99+
//Log.i("HabitEventTimelineFragment: Latitude received: ", ""+currentLon+"");
100100

101101
}
102102

@@ -409,8 +409,8 @@ public void mapsAll(int type ){
409409
bundle.putDoubleArray("lat", latititudes);
410410
bundle.putDoubleArray("lon", longitudes);
411411
bundle.putInt("type", type );
412-
bundle.putDouble("currentLat", currentLat);
413-
bundle.putDouble("currentLon", currentLon);
412+
//bundle.putDouble("currentLat", currentLat);
413+
//bundle.putDouble("currentLon", currentLon);
414414

415415
intent.putExtras(bundle);
416416
startActivity(intent);

app/src/main/java/com/cmput301f17t11/cupofjava/Views/MainActivity.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
public class MainActivity extends AppCompatActivity{
1818

1919
private String userName;
20-
private double currentLat;
21-
private double currentLon;
20+
//private double currentLat;
21+
//private double currentLon;
2222

2323
private BottomNavigationView.OnNavigationItemSelectedListener onNavigationItemSelectedListener
2424
= new BottomNavigationView.OnNavigationItemSelectedListener() {
@@ -28,8 +28,8 @@ public boolean onNavigationItemSelected(@NonNull MenuItem item) {
2828
case R.id.navigation_timeline:
2929
Bundle bundle1 = new Bundle();
3030
bundle1.putString("userName", userName);
31-
bundle1.putDouble("currentLat", currentLat);
32-
bundle1.putDouble("currentLon", currentLon);
31+
//bundle1.putDouble("currentLat", currentLat);
32+
//bundle1.putDouble("currentLon", currentLon);
3333
TimeLineFragment timeLineFragment = new TimeLineFragment();
3434
timeLineFragment.setArguments(bundle1);
3535
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
@@ -100,8 +100,8 @@ protected void onCreate(Bundle savedInstanceState) {
100100
setContentView(R.layout.activity_main);
101101

102102
this.userName = getIntent().getStringExtra("userName");
103-
this.currentLat = getIntent().getDoubleExtra("currentLat",0.0);
104-
this.currentLon = getIntent().getDoubleExtra("currentLon", 0.0);
103+
//this.currentLat = getIntent().getDoubleExtra("currentLat",0.0);
104+
//this.currentLon = getIntent().getDoubleExtra("currentLon", 0.0);
105105
BottomNavigationView navigation = (BottomNavigationView) findViewById(R.id.menu);
106106
navigation.setSelectedItemId(R.id.navigation_social);
107107
navigation.setOnNavigationItemSelectedListener(onNavigationItemSelectedListener);

app/src/main/java/com/cmput301f17t11/cupofjava/Views/UserLoginActivity.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ public class UserLoginActivity extends Activity {
3535
private User newUser;
3636
private User user;
3737

38-
double currentLat;
39-
double currentLong;
38+
//double currentLat;
39+
//double currentLong;
4040
Geolocation location;
4141

4242
/**
@@ -60,11 +60,11 @@ protected void onCreate(Bundle savedInstanceState) {
6060
@Override
6161
public void onClick(View v) {
6262

63-
Log.i("Location is ", location.getLocation().toString());
64-
currentLat = location.getLocation().getLatitude();
65-
currentLong = location.getLocation().getLongitude();
66-
Log.i("Latitude ", "" + currentLat + "");
67-
Log.i("Latitude ", "" + currentLong + "");
63+
//Log.i("Location is ", location.getLocation().toString());
64+
//currentLat = location.getLocation().getLatitude();
65+
//currentLong = location.getLocation().getLongitude();
66+
//Log.i("Latitude ", "" + currentLat + "");
67+
//Log.i("Latitude ", "" + currentLong + "");
6868

6969

7070
String input = username_editText.getText().toString();
@@ -88,8 +88,8 @@ public void onClick(View v) {
8888
//sending the user info to main activity
8989
Intent intent = new Intent(UserLoginActivity.this, MainActivity.class);
9090
intent.putExtra("userName", newUser.getUsername());
91-
intent.putExtra("currentLat", currentLat);
92-
intent.putExtra("currentLon", currentLong);
91+
//intent.putExtra("currentLat", currentLat);
92+
//intent.putExtra("currentLon", currentLong);
9393

9494
startActivity(intent);
9595

0 commit comments

Comments
 (0)