Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- I run my App in Device Version 4.3.1 Jelly Bean. When User is Login and If It Successful Then The store Basic Information in Credentials.
- In MainActivity I Direct set the value From Credential. like below code
- HeaderUsername = (TextView)findViewById(R.id.headerusername);
- if(BizApplication.getCredential().Name != null){
- String name = BizApplication.getCredential().Name;
- HeaderUsername.setText(name);
- }
- HeaderUserrole = (TextView)findViewById(R.id.headerrole);
- if(BizApplication.getCredential().Id != null){
- String role = BizApplication.getCredential().Role;
- HeaderUserrole.setText(role);
- }
- It's Work Fine in this device But I When Run this code in Lollipop Device that give me Error like below I don't know Why this Happening.
- Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference
Add Comment
Please, Sign In to add comment