Guest User

Untitled

a guest
Apr 6th, 2016
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. 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.
  2. In MainActivity I Direct set the value From Credential. like below code
  3.  
  4.  
  5. HeaderUsername = (TextView)findViewById(R.id.headerusername);
  6. if(BizApplication.getCredential().Name != null){
  7. String name = BizApplication.getCredential().Name;
  8. HeaderUsername.setText(name);
  9. }
  10.  
  11. HeaderUserrole = (TextView)findViewById(R.id.headerrole);
  12. if(BizApplication.getCredential().Id != null){
  13. String role = BizApplication.getCredential().Role;
  14. HeaderUserrole.setText(role);
  15. }
  16.  
  17.  
  18. 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.
  19.  
  20. 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