I have my project classes organized in multiple src folders, which have been working just fine until I changed the switch between activities, now incorporating passing of strings to the following activity. I think the problem is related to the class path.
Bundle bundle = new Bundle();
bundle.putString("email", userEmail);
Intent intent = new Intent(MainActivity.this,
com.fm.mondev.MeanSelection.class);
intent.putExtras(bundle);
startActivity(intent);
[EDIT] I realized the problem is not entirely related to the path of the Classes, even though I currently have MeanSelection.class instead of com.fm.mondev.MeanSelection.class. In fact, the problema seems to be related to the bundle. It works when I use it between the Login and Main activities, but not for activities subsequent to the Main one. I have also tried the alternate approach shown below. I have the subsequent activities edited accordingly.
Intent intent = new Intent(MainActivity.this,
MeanSelection.class);
intent.putExtra("email", userEmail);
startActivity(intent);
I have looked at my logcat but I can not detect anything useful. I know this works if I comment the putExtra(s) line.
[ANSWER] After seeking through every error line of the logcat and reading your answers, I realized there was a problem with one of the variables written via Log.d. So, the solution was to erase those lines, since they were there just to verify if the variables were rightly picked from the previous activities via the bundle. My conclusion is: from now on, I will not Log the strings passed from one activity to another. I'm not sure if this is really an issue with Android or just one of those things that comes with no feasible explanation, which we all know so well, but as soon as I erased those lines, I had my app up and running.
The app crashes when it should open the second activity. It's the following error that makes me believe this is related to the path: "E/AndroidRuntime(7115): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.fm/com.fm.mondev.MeanSelection}: java.lang.NullPointerException: println needs a message"
println needs a message has NOTHING to do with activity anything. Read your logcat!
I get this error when I try to Log
a null value, i.e.
String foo = emptyBundle.getString("barValue");
Log.d(TAG, foo) // error, Log output functions cannot output null values.
Log.d(TAG, "barValue: " + barValue); // outputs "barValue: null"
Make sure whatever you're Logging or System.out.printlning has a value.