I have a UI design for an application. As we know that there are two view while designing a UI for an app in android in eclipse one the xml view and other the graphical layout. i am having a problem that i cannot get graphical layout of my xml. it shows a null pointer exception when i switch to graphical layout. Any suggestions..?
I think you might find that the View.isInEditMode() function is what you are looking for.
Use it on any view that you have a reference to in the Activity.
If it returns true, don't attempt to get the reference that you were trying to get.
It's a little hard to tell if this will fix it for you, but you should definitely try this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With