java - Android app working in phones but not in tablets -
i've developed android app final project @ college. while developing used physical device testing, android phone 4.4 kitkat. used several smartphone emulators test ui different android versions , worked fine. problem appears when tried run app on tablet, throws java null pointer exception pointing @ button listener (setonclicklistener()). (all buttons belong fragment) have problems when run tablet emulator. didn't post code here because null pointer exception belongs first listener declare, , maybe has device. resume mention above, if it's tablet won't work (even emulator, null pointer exception thrown). if it's phone work. ideas? in advance.
your question not clear. guess you've different layouts tab , phone. need post layouts in case.
i had similar problem once, i'm guessing that, tab layout has button (which creating null pointer exception) android:onclick="onclick"
attribute in declaration. if implicitly implement setonclicklistener
button
in activity not necessary set onclick
attribute. if activity doesn't have onclick
function, button referring onclick
function, it'll null pointer exception.
Comments
Post a Comment