i have the problem when i want to update element in activity with intent.actually i can getparams and set to element..but the problem is when i’m not using intent i’m using method to set value of my element ..this is my code
this code i’m place in ChatActivity.java
/*
* set element attribute
*/
public void setAttr(String value){
welcome = (TextView)findViewById(R.id.txtWelcome);
welcome.setText("welcome " + value);
}
and i’m call that code in another class , that class is ProcessChat.java
public void welcome(){
ChatActivity chat = new ChatActivity();
chat.setAttr("user");
}
when i’m run i’m get the error java.lang.null….
what’s wrong ? how ican fix this..
thanks for your answer..
Put following code to create new intent in ProcessChat
Put this code in OnCreate method of ChatActivity
OR
put following code before
welcome = (TextView)findViewById(R.id.txtWelcome)