Hi there,
Here I try to send the "message" string ("Lorem,Ipsum,Dolor,Amet") :
And here I try to fetch this "message" string :
But it seems that "message" is not a string, or there's something wrong with it, because String[] array = message.split(","); just makes my program crash.
However I noticed that the following would not crash :
Could someone please give me an advice ?
Here I try to send the "message" string ("Lorem,Ipsum,Dolor,Amet") :
Code:
public void dbInsertWords(View view) {
Intent intent = new Intent(this, DbInsertWords.class);
String message = "Lorem,Ipsum,Dolor,Amet" ;
intent.putExtra(EXTRA_MESSAGE, message);
startActivity(intent);
}
And here I try to fetch this "message" string :
Code:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent intent = getIntent();
String message = intent.getStringExtra(DbInsertWords.EXTRA_MESSAGE);
[B]String[] array = message.split(","); <=== *** this line crashes ***
[/B]
WordsBDD wordBdd = new WordsBDD(this);
Word word = new Word(array[0], array[1], array[2], array[3]);
But it seems that "message" is not a string, or there's something wrong with it, because String[] array = message.split(","); just makes my program crash.
However I noticed that the following would not crash :
Code:
String[] array = "Lorem,Ipsum,Dolor,Amet".split(",");
Could someone please give me an advice ?