//Check intent is null or not before you get data
Intent intent=this.getIntent();
if(intent !=null){
// do something you want
}
//example
//In ClassA:
Intent intent = new Intent(this, ClassB);
String[] myStrings = new String[] {"test", "test2"};
intent.putExtra("strings", myStrings);
startActivity(intent);
//In ClassB:
Intent intent = getIntent();
if(intent !=null){
String[] myStrings = intent.getStringArrayExtra("strings");
}
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.