i am sending the values to pag2.java as follows
Intent myIntent = new Intent(getApplicationContext(), page2.class);
intent.putExtra("pos", list1);
intent.putExtra("back1", "back");
startActivity(myIntent);
And recieving in page2 as
Intent intent = getIntent();
pos = intent.getStringExtra("pos");
I am getting the following error:
FATAL EXCEPTION: main
Process: com.example.namrathasrinivas.karnatakatemples, PID: 4410
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.namrathasrinivas.karnatakatemples/com.example.namrathasrinivas.karnatakatemples.page2}: java.lang.NullPointerException: println needs a message
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2184)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException: println needs a message
at android.util.Log.println_native(Native Method)
at android.util.Log.d(Log.java:139)
at com.example.namrathasrinivas.karnatakatemples.page2.onCreate(page2.java:41)
at android.app.Activity.performCreate(Activity.java:5231)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148)