In your Activity A, you have this
@Override
public void onClick(View v) {
if (queryString == R.drawable.cardviewone) {
Intent intenting = new Intent(getApplicationContext(), ActivityB.class);
String one = "yesone";
intenting.putExtra("Fiveold", one);
startActivity(intenting);
} else if (queryString == R.drawable.cardviewtwo) {
Intent intenting = new Intent(getApplicationContext(), ActivityB.class);
String two = "yestwo";
intenting.putExtra("Fivenew", two);
startActivity(intenting);
} else if{...}
You are using if-else condition. Debugger will run to Activity B if one of the condition is matched. Assuming it matches with the
if (queryString == R.drawable.cardviewone)
, it will only pass "Fiveold" to Activity B and hence you will get nullPointerExeption in this line
String smss =intent.getStringExtra("Fivenew").toString();
since it is not going to run another condition.
I hope it is clear for you.