I have this string: "no_questions_by_user" in a variable named result.
than I do this check:
if ( result != null && result.equals( "no_user_id" ) )
{
Log.d( "Post execute: " , "NOOOT OKKKK - no user id" );
}
else
if ( result != null && result.equals( "database_error" ) )
{
Log.d( "Post execute: " , "NOOOT OKKKK - database error" );
}
else
if ( result != null && result.equals( "no_questions_by_user" ) )
{
Log.d( "Post execute: " , "NOOOT OKKKK - no questions by user so far" );
}
else
{
Log.d( "MyQuestionsActivity" , "In JSON parsing area.." );
}
and it always goes to the last else. But in my understanding it should really go to the block which checks result.equals( "no_questions_by_user" )
any idea why that block does not get executed?
Thanks!!
The code looks good. Your variable
resultmust have another value.My guess is that there are some whitespaces at the end or beginning of your result string.