codingdir logo sitemap sitemap |

NullPointerException while passing data through Intent

By : , Category : android

Use this method to getExtra

sub = (String) getIntent().getSerializableExtra("cek");


Just you Log.i("Activity", countryCode );

To make your your countrycode is not null

ReLated :

In your SecondActivity By this line your Intent is null

Intent intent = null;

change this into

Intent intent = getIntent();

That too there is one more thing in your Parcelable.. The order in what what way you have written in your writeToParcel() method you need to follow the same in Quiz(Parcel source)

Don't use getExtras(), but


More info here.

The problem is, you don't init your RadioGroup button radioGroup in your Quiz1 class.

saved instance state is only use when the device rotates or something alone those lines where your activity is temporarily paused then re-created so using that there wont do anything if you are launching an activity.

you need to use getIntent() to get the object


Message :
Login to Add Your Comments .
How to disable registered OpenCL platforms on Windows?
Is Observable broken in Angular 2 Beta 3?
Cross-thread operation not valid when using Invoke
How to pass an IEnumerable or queryable list of properties from Controller to View
Finding numbers after a certain keyword using Python
Pocketsphinx recognizes random phrases in a silence
Passing non-thread-safe objects through thread-safe containers
React scroll nav
BizTalk WCF-BasicHttp Adapter does not allow Empty string for Service Certificate Props
Why property ''cause" of Exception is repeating forever?
Privacy Policy 2017 © All Rights Reserved .